rvmify 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
@@ -0,0 +1,21 @@
1
+ ## MAC OS
2
+ .DS_Store
3
+
4
+ ## TEXTMATE
5
+ *.tmproj
6
+ tmtags
7
+
8
+ ## EMACS
9
+ *~
10
+ \#*
11
+ .\#*
12
+
13
+ ## VIM
14
+ *.swp
15
+
16
+ ## PROJECT::GENERAL
17
+ coverage
18
+ rdoc
19
+ pkg
20
+
21
+ ## PROJECT::SPECIFIC
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Steve Agalloco
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,21 @@
1
+ = rvmify
2
+
3
+ Description goes here.
4
+
5
+ Dir.glob("*").each do |dir|
6
+ Rvmify.generate(dir)
7
+ end
8
+
9
+ == Note on Patches/Pull Requests
10
+
11
+ * Fork the project.
12
+ * Make your feature addition or bug fix.
13
+ * Add tests for it. This is important so I don't break it in a
14
+ future version unintentionally.
15
+ * Commit, do not mess with rakefile, version, or history.
16
+ (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
17
+ * Send me a pull request. Bonus points for topic branches.
18
+
19
+ == Copyright
20
+
21
+ Copyright (c) 2010 Steve Agalloco. See LICENSE for details.
@@ -0,0 +1,55 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ $LOAD_PATH.unshift 'lib'
5
+
6
+ begin
7
+ require 'jeweler'
8
+ require 'rvmify'
9
+ Jeweler::Tasks.new do |gem|
10
+ gem.name = "rvmify"
11
+ gem.summary = %Q{get up and running quickly with rvm, gemsets and bundler}
12
+ gem.description = %Q{get up and running quickly with rvm, gemsets and bundler}
13
+ gem.email = "steve.agalloco@gmail.com"
14
+ gem.homepage = "http://github.com/spagalloco/rvmify"
15
+ gem.authors = ["Steve Agalloco"]
16
+ gem.version = Rvmify::VERSION
17
+ gem.bindir = 'bin'
18
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
19
+ end
20
+ Jeweler::GemcutterTasks.new
21
+ rescue LoadError
22
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
23
+ end
24
+
25
+ require 'rake/testtask'
26
+ Rake::TestTask.new(:test) do |test|
27
+ test.libs << 'lib' << 'test'
28
+ test.pattern = 'test/**/test_*.rb'
29
+ test.verbose = true
30
+ end
31
+
32
+ begin
33
+ require 'rcov/rcovtask'
34
+ Rcov::RcovTask.new do |test|
35
+ test.libs << 'test'
36
+ test.pattern = 'test/**/test_*.rb'
37
+ test.verbose = true
38
+ end
39
+ rescue LoadError
40
+ task :rcov do
41
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
42
+ end
43
+ end
44
+
45
+ task :test => :check_dependencies
46
+
47
+ task :default => :test
48
+
49
+ require 'rake/rdoctask'
50
+ Rake::RDocTask.new do |rdoc|
51
+ rdoc.rdoc_dir = 'rdoc'
52
+ rdoc.title = "rvmify #{Rvmify::VERSION}"
53
+ rdoc.rdoc_files.include('README*')
54
+ rdoc.rdoc_files.include('lib/**/*.rb')
55
+ end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ require 'rvmify'
3
+
4
+ dir = ARGV.shift
5
+
6
+ abort("No directory found") if dir.nil?
7
+
8
+ begin
9
+ Rvmify.generate(File.expand_path(dir))
10
+ rescue => e
11
+ abort(e.message)
12
+ rescue Timeout::Error => e
13
+ abort("Request Timeout")
14
+ end
@@ -0,0 +1,51 @@
1
+ module Rvmify
2
+ VERSION = '0.1.0'
3
+
4
+ class << self
5
+
6
+ def write_unless_exists(path, filename, contents)
7
+ writefile = File.join(path, filename)
8
+ unless File.exist?(writefile)
9
+ File.open(writefile, 'w') { |f| f.write(contents) }
10
+ else
11
+ puts "#{writefile} not written, #{writefile} already exists!"
12
+ end
13
+ end
14
+
15
+ def rvmrc_file(project_name)
16
+
17
+ ruby_path = `which ruby`.strip
18
+ ruby_version = File.basename(ruby_path.gsub(/\/bin\/ruby/,''))
19
+
20
+ gem_home = `echo $GEM_HOME` # /Users/steve/.rvm/gems/ree-1.8.7-2010.02
21
+ environment_path = gem_home.gsub('/gems/', '/environments/').strip
22
+
23
+ # Project specific .rvmrc file
24
+ contents = <<-END
25
+ if [[ -s "#{environment_path}" ]] ; then
26
+ . "#{environment_path}"
27
+ else
28
+ rvm --create use "#{ruby_version}"
29
+ fi
30
+
31
+ [[ -s "#{project_name}.gems" ]] && rvm gemset import #{project_name}.gems
32
+
33
+ bundle install
34
+ END
35
+ end
36
+
37
+ def generate(path)
38
+ project_name = File.basename(path)
39
+
40
+ # .gems file
41
+ write_unless_exists(path, "#{project_name}.gems", "bundler -v0.9.26")
42
+
43
+ # Gemfile
44
+ write_unless_exists(path, "Gemfile", "#install all project gems here")
45
+
46
+ # Project specific .rvmrc file
47
+ write_unless_exists(path, ".rvmrc", rvmrc_file(project_name))
48
+ end
49
+
50
+ end
51
+ end
@@ -0,0 +1,53 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{rvmify}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Steve Agalloco"]
12
+ s.date = %q{2010-06-24}
13
+ s.default_executable = %q{rvmify}
14
+ s.description = %q{get up and running quickly with rvm, gemsets and bundler}
15
+ s.email = %q{steve.agalloco@gmail.com}
16
+ s.executables = ["rvmify"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ ".gitignore",
24
+ "LICENSE",
25
+ "README.rdoc",
26
+ "Rakefile",
27
+ "bin/rvmify",
28
+ "lib/rvmify.rb",
29
+ "rvmify.gemspec",
30
+ "test/helper.rb",
31
+ "test/test_rvmify.rb"
32
+ ]
33
+ s.homepage = %q{http://github.com/spagalloco/rvmify}
34
+ s.rdoc_options = ["--charset=UTF-8"]
35
+ s.require_paths = ["lib"]
36
+ s.rubygems_version = %q{1.3.7}
37
+ s.summary = %q{get up and running quickly with rvm, gemsets and bundler}
38
+ s.test_files = [
39
+ "test/helper.rb",
40
+ "test/test_rvmify.rb"
41
+ ]
42
+
43
+ if s.respond_to? :specification_version then
44
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
45
+ s.specification_version = 3
46
+
47
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
48
+ else
49
+ end
50
+ else
51
+ end
52
+ end
53
+
@@ -0,0 +1,9 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+
4
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
5
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
6
+ require 'rvmify'
7
+
8
+ class Test::Unit::TestCase
9
+ end
@@ -0,0 +1,7 @@
1
+ require 'helper'
2
+
3
+ class TestRvmify < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rvmify
3
+ version: !ruby/object:Gem::Version
4
+ hash: 27
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 0
10
+ version: 0.1.0
11
+ platform: ruby
12
+ authors:
13
+ - Steve Agalloco
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-06-24 00:00:00 -04:00
19
+ default_executable: rvmify
20
+ dependencies: []
21
+
22
+ description: get up and running quickly with rvm, gemsets and bundler
23
+ email: steve.agalloco@gmail.com
24
+ executables:
25
+ - rvmify
26
+ extensions: []
27
+
28
+ extra_rdoc_files:
29
+ - LICENSE
30
+ - README.rdoc
31
+ files:
32
+ - .document
33
+ - .gitignore
34
+ - LICENSE
35
+ - README.rdoc
36
+ - Rakefile
37
+ - bin/rvmify
38
+ - lib/rvmify.rb
39
+ - rvmify.gemspec
40
+ - test/helper.rb
41
+ - test/test_rvmify.rb
42
+ has_rdoc: true
43
+ homepage: http://github.com/spagalloco/rvmify
44
+ licenses: []
45
+
46
+ post_install_message:
47
+ rdoc_options:
48
+ - --charset=UTF-8
49
+ require_paths:
50
+ - lib
51
+ required_ruby_version: !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ hash: 3
66
+ segments:
67
+ - 0
68
+ version: "0"
69
+ requirements: []
70
+
71
+ rubyforge_project:
72
+ rubygems_version: 1.3.7
73
+ signing_key:
74
+ specification_version: 3
75
+ summary: get up and running quickly with rvm, gemsets and bundler
76
+ test_files:
77
+ - test/helper.rb
78
+ - test/test_rvmify.rb