runcoderun-rcr_gem_installer 0.1.1

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/History.txt ADDED
@@ -0,0 +1,6 @@
1
+ === 1.0.0 / 2008-09-05
2
+
3
+ * 1 major enhancement
4
+
5
+ * Birthday!
6
+
data/Manifest ADDED
@@ -0,0 +1,9 @@
1
+ bin/rcr_gem_installer
2
+ History.txt
3
+ lib/rcr/gem_installer.rb
4
+ lib/runcoderun_gems.txt
5
+ Manifest
6
+ Manifest.txt
7
+ Rakefile
8
+ README.txt
9
+ spec/gem_installer_spec.rb
data/Manifest.txt ADDED
@@ -0,0 +1,7 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.txt
4
+ Rakefile
5
+ bin/gem_test
6
+ lib/gem_test.rb
7
+ test/test_gem_test.rb
data/README.txt ADDED
@@ -0,0 +1,48 @@
1
+ = GemTest
2
+
3
+ * FIX (url)
4
+
5
+ == DESCRIPTION:
6
+
7
+ FIX (describe your package)
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * FIX (list of features or problems)
12
+
13
+ == SYNOPSIS:
14
+
15
+ FIX (code sample of usage)
16
+
17
+ == REQUIREMENTS:
18
+
19
+ * FIX (list of requirements)
20
+
21
+ == INSTALL:
22
+
23
+ * FIX (sudo gem install, anything else)
24
+
25
+ == LICENSE:
26
+
27
+ (The MIT License)
28
+
29
+ Copyright (c) 2008 FIX
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ 'Software'), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be
40
+ included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ require 'rubygems'
2
+ require 'echoe'
3
+ require './lib/rcr/gem_installer.rb'
4
+
5
+ Echoe.new('rcr_gem_installer', Rcr::GemInstaller::VERSION) do |p|
6
+ p.rubyforge_name = 'rcr_gem_installer'
7
+ p.email = 'rob@runcoderun.com'
8
+ p.author = ["Rob Sanheim @ Relevance"]
9
+ p.summary = "Tool to install dependancies for RunCodeRun, though it coudl be used to bootstrap your own machines as well."
10
+ p.url = "http://runcoderun.com"
11
+ p.test_pattern = 'spec/**/*_spec.rb'
12
+ end
File without changes
@@ -0,0 +1,51 @@
1
+ require 'ostruct'
2
+
3
+ module Rcr
4
+ class GemInstaller
5
+ VERSION = '0.1.1'
6
+ GITHUB = "http://gems.github.com"
7
+ GEM_LIST = ENV["GEM_LIST"] || ARGV[0] || File.join(File.dirname(__FILE__), *%w[gems.txt])
8
+
9
+ def self.install_gems
10
+ gem_list = File.read(GEM_LIST)
11
+ convert_gem_list(gem_list).each do |gem|
12
+ if gem_installed?(gem.name, gem.version)
13
+ puts "skipping #{gem.name} #{gem.version}"
14
+ next
15
+ end
16
+ cmd = "gem install #{gem.name} --no-ri --no-rdoc"
17
+ cmd << " --version #{gem.version}" if gem.version
18
+ puts cmd
19
+ puts `#{cmd}`
20
+ unless $?.success?
21
+ cmd << " --source #{GITHUB}"
22
+ puts "***** WARNING Trying to install gem #{gem.name} from github - watch for security issues."
23
+ puts cmd
24
+ puts `#{cmd}`
25
+ end
26
+ end
27
+ end
28
+
29
+ def self.convert_gem_list(string)
30
+ gems = []
31
+ string.each do |line|
32
+ result = line.match(/([\w\-_]*) \((.*)\)/)
33
+ next unless result && result[1]
34
+ versions = result[2] ? result[2].split(",") : ""
35
+ versions.each do |version|
36
+ gems << OpenStruct.new(:name => result[1], :version => version.strip)
37
+ end
38
+ end
39
+ gems
40
+ end
41
+
42
+ def self.gem_installed?(name, version)
43
+ installed_gems.detect {|gem| gem.name == name && gem.version == version}
44
+ end
45
+
46
+ def self.installed_gems
47
+ @installed_gems ||= convert_gem_list `gem list`
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,75 @@
1
+ activesupport (2.1.1, 2.1.0, 2.0.2, 2.0.1, 1.4.4)
2
+ acts_as_reportable (1.1.1)
3
+ allison (2.0.3)
4
+ archive-tar-minitar (0.5.2)
5
+ arrayfields (4.6.0)
6
+ bcrypt-ruby (2.0.3)
7
+ beanstalk-client (1.0.2)
8
+ bj (1.0.1)
9
+ builder (2.1.2)
10
+ camping (1.5)
11
+ color (1.4.0)
12
+ daemons (1.0.10)
13
+ diff-lcs (1.1.2)
14
+ echoe (3)
15
+ facets (2.4.4, 2.4.1, 2.3.0, 2.2.1, 2.2.0, 2.1.3, 2.0.5)
16
+ fastercsv (1.2.3)
17
+ fattr (1.0.3)
18
+ flexmock (0.8.2)
19
+ flog (1.1.0)
20
+ git (1.0.5)
21
+ god (0.7.8)
22
+ haml (2.0.2, 2.0.1)
23
+ heckle (1.4.1)
24
+ highline (1.4.0)
25
+ htmlentities (4.0.0)
26
+ hoe (1.7.0)
27
+ hpricot (0.6)
28
+ icalendar (1.0.2)
29
+ image_science (1.1.3)
30
+ json (1.1.3)
31
+ launchy (0.3.2)
32
+ libxml-ruby (0.8.3)
33
+ log_buddy (0.0.5)
34
+ main (2.8.2)
35
+ markaby (0.5)
36
+ metaid (1.0)
37
+ mime-types (1.15)
38
+ mocha (0.9.0)
39
+ mosquito (0.1.3)
40
+ mysql (2.7)
41
+ open4 (0.9.6)
42
+ orderedhash (0.0.4)
43
+ ParseTree (2.2.0)
44
+ pdf-writer (1.1.8)
45
+ picnic (0.6.4)
46
+ polyglot (0.2.3)
47
+ rack (0.4.0)
48
+ rails (2.1.0, 2.0.2, 2.0.1, 1.2.6)
49
+ rake (0.8.1)
50
+ rcov (0.8.1.2.0)
51
+ RedCloth (4.0.3, 4.0.1, 3.0.4, 3.0.3)
52
+ redgreen (1.2.2)
53
+ relevance-github_hook (0.5.8)
54
+ rest-client (0.7)
55
+ rmagick (2.5.2)
56
+ rspec (1.1.4)
57
+ ruby-json (1.1.2)
58
+ ruby2ruby (1.1.9)
59
+ rubyforge (1.0.0)
60
+ RubyInline (3.7.0)
61
+ ruport (1.6.1)
62
+ Shoulda (1.1.1)
63
+ sql-parser (0.0.2)
64
+ sqlite3-ruby (1.2.1)
65
+ systemu (1.2.0)
66
+ technicalpickles-echoe (3)
67
+ test-spec (0.9.0)
68
+ tinder (1.1.7)
69
+ transaction-simple (1.4.0)
70
+ treetop (1.2.4)
71
+ uuidtools (1.0.3)
72
+ validatable (1.6.7)
73
+ wikitext (1.1.99)
74
+ will_paginate (2.2.2)
75
+ ZenTest (3.10.0)
@@ -0,0 +1,35 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{rcr_gem_installer}
3
+ s.version = "0.1.1"
4
+
5
+ s.required_rubygems_version = Gem::Requirement.new("= 1.2") if s.respond_to? :required_rubygems_version=
6
+ s.authors = ["Rob Sanheim @ Relevance"]
7
+ s.date = %q{2008-09-09}
8
+ s.default_executable = %q{rcr_gem_installer}
9
+ s.description = %q{Tool to install dependancies for RunCodeRun, though it coudl be used to bootstrap your own machines as well.}
10
+ s.email = %q{rob@runcoderun.com}
11
+ s.executables = ["rcr_gem_installer"]
12
+ s.extra_rdoc_files = ["bin/rcr_gem_installer", "lib/rcr/gem_installer.rb", "lib/runcoderun_gems.txt", "README.txt"]
13
+ s.files = ["bin/rcr_gem_installer", "History.txt", "lib/rcr/gem_installer.rb", "lib/runcoderun_gems.txt", "Manifest", "Manifest.txt", "Rakefile", "README.txt", "spec/gem_installer_spec.rb", "rcr_gem_installer.gemspec"]
14
+ s.has_rdoc = true
15
+ s.homepage = %q{http://runcoderun.com}
16
+ s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Rcr_gem_installer", "--main", "README.txt"]
17
+ s.require_paths = ["lib"]
18
+ s.rubyforge_project = %q{rcr_gem_installer}
19
+ s.rubygems_version = %q{1.2.0}
20
+ s.summary = %q{Tool to install dependancies for RunCodeRun, though it coudl be used to bootstrap your own machines as well.}
21
+ s.test_files = ["spec/gem_installer_spec.rb"]
22
+
23
+ if s.respond_to? :specification_version then
24
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
25
+ s.specification_version = 2
26
+
27
+ if current_version >= 3 then
28
+ s.add_development_dependency(%q<echoe>, [">= 0"])
29
+ else
30
+ s.add_dependency(%q<echoe>, [">= 0"])
31
+ end
32
+ else
33
+ s.add_dependency(%q<echoe>, [">= 0"])
34
+ end
35
+ end
@@ -0,0 +1,28 @@
1
+ require 'test/spec'
2
+
3
+ require File.join(File.dirname(__FILE__), *%w[.. lib rcr gem_installer])
4
+
5
+ describe 'GemInstaller' do
6
+
7
+ it "parses simple gem name" do
8
+ gems = Rcr::GemInstaller.convert_gem_list("daemons (1.0.10)")
9
+ gems.first.name.should == "daemons"
10
+ end
11
+
12
+ it "parses name with dashes" do
13
+ gems = Rcr::GemInstaller.convert_gem_list("diff-lcs (1.0.10)")
14
+ gems.first.name.should == "diff-lcs"
15
+ end
16
+
17
+ it "parses name with underscores" do
18
+ gems = Rcr::GemInstaller.convert_gem_list("spec_converter_foo (1.0.10)")
19
+ gems.first.name.should == "spec_converter_foo"
20
+ end
21
+
22
+ it "parses with multiple versions" do
23
+ gems = Rcr::GemInstaller.convert_gem_list("foo (1.0.10, 1.0.11)")
24
+ gems[0].version.should == "1.0.10"
25
+ gems[1].version.should == "1.0.11"
26
+ end
27
+
28
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: runcoderun-rcr_gem_installer
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Rob Sanheim @ Relevance
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-09-09 00:00:00 -07:00
13
+ default_executable: rcr_gem_installer
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: echoe
17
+ version_requirement:
18
+ version_requirements: !ruby/object:Gem::Requirement
19
+ requirements:
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: "0"
23
+ version:
24
+ description: Tool to install dependancies for RunCodeRun, though it coudl be used to bootstrap your own machines as well.
25
+ email: rob@runcoderun.com
26
+ executables:
27
+ - rcr_gem_installer
28
+ extensions: []
29
+
30
+ extra_rdoc_files:
31
+ - bin/rcr_gem_installer
32
+ - lib/rcr/gem_installer.rb
33
+ - lib/runcoderun_gems.txt
34
+ - README.txt
35
+ files:
36
+ - bin/rcr_gem_installer
37
+ - History.txt
38
+ - lib/rcr/gem_installer.rb
39
+ - lib/runcoderun_gems.txt
40
+ - Manifest
41
+ - Manifest.txt
42
+ - Rakefile
43
+ - README.txt
44
+ - spec/gem_installer_spec.rb
45
+ - rcr_gem_installer.gemspec
46
+ has_rdoc: true
47
+ homepage: http://runcoderun.com
48
+ post_install_message:
49
+ rdoc_options:
50
+ - --line-numbers
51
+ - --inline-source
52
+ - --title
53
+ - Rcr_gem_installer
54
+ - --main
55
+ - README.txt
56
+ require_paths:
57
+ - lib
58
+ required_ruby_version: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ">="
61
+ - !ruby/object:Gem::Version
62
+ version: "0"
63
+ version:
64
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "="
67
+ - !ruby/object:Gem::Version
68
+ version: "1.2"
69
+ version:
70
+ requirements: []
71
+
72
+ rubyforge_project: rcr_gem_installer
73
+ rubygems_version: 1.2.0
74
+ signing_key:
75
+ specification_version: 2
76
+ summary: Tool to install dependancies for RunCodeRun, though it coudl be used to bootstrap your own machines as well.
77
+ test_files:
78
+ - spec/gem_installer_spec.rb