romyow 0.0.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.
Files changed (7) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +19 -0
  3. data/README.md +79 -0
  4. data/bin/romyow +42 -0
  5. data/lib/romyow/path.rb +18 -0
  6. data/lib/romyow.rb +5 -0
  7. metadata +64 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7bca6c886779ee988f3a4724cb52dfce7dfea0ea
4
+ data.tar.gz: 565fb13375f940d3044e47ae016b1b25a37344fb
5
+ SHA512:
6
+ metadata.gz: e73b6c0c9c7a6081c61bbab277b13abe575f94814a46ff8c09639854eb1aa79b37ed209d9a5aec0409b3c48828a3e5faf43701a33a4280e84255a48e7b895f2b
7
+ data.tar.gz: 21499f45b9aecfc341a434332ddf36fa9732f37cff5ea95a99f475aa3ac36d1dc00abcfab21e82bba22572aea372e8f27122287c5a4d2d7c1b44b8168fa7574a
data/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2013 Cecille Manalang
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in all
11
+ copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,79 @@
1
+ ROll MY OWn: Ruby Version Manager
2
+ =================================
3
+
4
+ Simple tool to easily change your machine's ruby version to your liking.
5
+
6
+ Disclaimer
7
+ ----------
8
+
9
+ I am only been testing on Mac. I still haven't tried testing on Ubuntu or Windows.
10
+
11
+ History
12
+ -------
13
+
14
+ Since the machine that I am using right now doesn't have that much capacity to store a lot, I became picky with the tools that I install.
15
+ I first make sure that they satisfy what I really wanted.
16
+
17
+ I have read a lot about the other ruby version managers out there (their documentation, code and stuff like that) and
18
+ I realized that the only thing I really wanted in a version manager is a method to set my path to where I installed the ruby that I want to use.
19
+
20
+ I haven't been experiencing any problems with my setup right now but if anyone found that this method will eventually break something feel free to comment.
21
+
22
+
23
+ Requirement
24
+ -----------
25
+
26
+ As of this writing, the gem assumes that your rubies are compiled and installed in `~/.rubies` directory
27
+
28
+ Usage
29
+ -----
30
+
31
+ 1. Install the gem `gem install romyow`
32
+ 2. Create a `.ruby-version` file on your current directory `echo '2.0.0-p0' > .ruby-version`
33
+ 3. Run `romyow`
34
+
35
+ Alternatively, you can run `romyow $ruby_version` if you don't want to have a separate `.ruby-version` file
36
+
37
+ 4. See the changes to your env paths
38
+
39
+ * `echo $PATH` : `$HOME/.rubies/2.0.0-p0/bin:$PATH`
40
+ * `gem env home` : `$HOME/.rubies/2.0.0-p0/lib/ruby/gems/2.0.0`
41
+ * `gem env path` : `$HOME/.gem/ruby/2.0.0:$HOME/.rubies/2.0.0-p0/lib/ruby/gems/2.0.0`
42
+
43
+ Optional Instructions
44
+ ---------------------
45
+
46
+ * Add `romyow` to your `~/.bash_profile` to automatically set up your ruby env upon logging in to your shell
47
+
48
+ ```
49
+ command -v romyow >/dev/null && romyow
50
+ ```
51
+
52
+ * Customize bash prompt (this is to make sure your bash prompt does not change to default when you use romyow)
53
+
54
+ ```
55
+ export PS1="\h:\W \u\$ "
56
+ export PS2="\h:\W \u\$ "
57
+ export PS3="\h:\W \u\$ "
58
+ export PS4="\h:\W \u\$ "
59
+ ```
60
+
61
+ TODO
62
+ ----
63
+
64
+ 1. Ability to compile and install rubies in the `~/.rubies` directory for full RVM experience
65
+ 2. Ability to uninstall rubies
66
+
67
+ Contributing
68
+ ------------
69
+
70
+ 1. Fork it
71
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
72
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
73
+ 4. Push to the branch (`git push origin my-new-feature`)
74
+ 5. Create new Pull Request
75
+
76
+ Credits
77
+ -------
78
+
79
+ This project is highly inspired by [gs](http://github.com/soveran/gs)
data/bin/romyow ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ help = <<EOF
4
+ ROMYOW 1 2012-03-17 0.0.1
5
+
6
+ NAME
7
+
8
+ romyow - a tool to easily change ruby version
9
+
10
+ SYNOPSIS
11
+
12
+ romyow help
13
+ romyow [ruby_version]
14
+
15
+ DESCRIPTION
16
+
17
+ Configures PATH to point to the directory of the ruby version
18
+ and starts a new shell session given the changes to the env variables
19
+
20
+ COMMANDS
21
+
22
+ `help`
23
+ Display help message
24
+
25
+ `[ruby_version]`
26
+ variable to which version your PATH will be set.
27
+ (default will be from a '.ruby-version' file or to system)
28
+ EOF
29
+
30
+ require 'romyow'
31
+
32
+ if ARGV[0] == 'help'
33
+ puts help
34
+ else
35
+ ruby_version = File.exists?('.ruby-version') ? File.read('.ruby-version') : ARGV[0]
36
+
37
+ path = Romyow::Path.new(:ruby_version => ruby_version)
38
+
39
+ ENV["PATH"] = [path.ruby, ENV["PATH"]].compact.join(':')
40
+
41
+ exec ENV["SHELL"]
42
+ end
@@ -0,0 +1,18 @@
1
+ class Romyow::Path
2
+ attr_accessor :ruby_version, :home
3
+
4
+ def initialize(options={})
5
+ self.ruby_version = options[:ruby_version].strip if options[:ruby_version]
6
+ self.home = ENV["HOME"]
7
+ end
8
+
9
+ def ruby
10
+ existing_path("#{self.home}/.rubies/#{self.ruby_version}/bin") || '/usr/bin'
11
+ end
12
+
13
+ private
14
+
15
+ def existing_path(path)
16
+ File.directory?(path) ? path : nil
17
+ end
18
+ end
data/lib/romyow.rb ADDED
@@ -0,0 +1,5 @@
1
+ module Romyow
2
+ VERSION = '0.0.1'
3
+ end
4
+
5
+ require 'romyow/path'
metadata ADDED
@@ -0,0 +1,64 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: romyow
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Cecille Manalang
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-03-16 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: minitest
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description: Allows easy changing of ruby and gem paths for multiple ruby versions
28
+ setup
29
+ email: c.an.04.07@gmail.com
30
+ executables:
31
+ - romyow
32
+ extensions: []
33
+ extra_rdoc_files: []
34
+ files:
35
+ - README.md
36
+ - LICENSE
37
+ - bin/romyow
38
+ - lib/romyow/path.rb
39
+ - lib/romyow.rb
40
+ homepage: http://github.com/cecillem/romyow
41
+ licenses:
42
+ - MIT
43
+ metadata: {}
44
+ post_install_message:
45
+ rdoc_options: []
46
+ require_paths:
47
+ - lib
48
+ required_ruby_version: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - '>='
51
+ - !ruby/object:Gem::Version
52
+ version: '0'
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
58
+ requirements: []
59
+ rubyforge_project:
60
+ rubygems_version: 2.0.0
61
+ signing_key:
62
+ specification_version: 4
63
+ summary: 'ROll MY OWn: Ruby Version Manager'
64
+ test_files: []