simple_gemset 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/simple_gemset +67 -0
  2. metadata +99 -0
data/bin/simple_gemset ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+ require "rubygems"
3
+ require "thor/group"
4
+
5
+ class Simple_gemset < Thor::Group
6
+ include Thor::Actions
7
+
8
+ desc "Generate .rvmrc file"
9
+
10
+ argument :gemset, :type => :string, :default => File.basename(Dir.getwd)
11
+
12
+ class_option :ruby, :type => :boolean, :default => false
13
+
14
+ def new
15
+ ruby_options = [
16
+ 'ruby-1.8.6-p420',
17
+ 'ruby-1.8.6-head',
18
+ 'ruby-1.8.7-p352',
19
+ 'ruby-1.8.7-head',
20
+ 'ruby-1.9.1-p378',
21
+ 'ruby-1.9.1-p431',
22
+ 'ruby-1.9.1-head',
23
+ 'ruby-1.9.2-p180',
24
+ 'ruby-1.9.2-p290',
25
+ 'ruby-1.9.2-head',
26
+ 'ruby-1.9.3-head',
27
+ 'ruby-head',
28
+ 'goruby',
29
+ 'jruby-1.2.0',
30
+ 'jruby-1.3.1',
31
+ 'jruby-1.4.0',
32
+ 'jruby-1.6.1',
33
+ 'jruby-1.6.2'
34
+ ]
35
+
36
+ if ENV['testing']
37
+ rvmrc_path = 'spec/rvmrc'
38
+ else
39
+ rvmrc_path = '.rvmrc'
40
+ end
41
+
42
+ if options[:ruby]
43
+ say('Choose which Ruby version do you want to use') unless ENV['testing']
44
+ ruby_options.each_index { |i| puts i.to_s+': '+ ruby_options[i] } unless ENV['testing']
45
+
46
+ ruby_option = 7
47
+ if not ENV['testing']
48
+ ruby_option = ask('Which ruby? Just tell me the number: ')
49
+ end
50
+
51
+ create_file(rvmrc_path) do
52
+ "# Generated with Simple_gemset \n" +
53
+ "rvm use '#{ruby_options[ruby_option.to_i]}'\n" +
54
+ "rvm gemset create '#{gemset}'\n" +
55
+ "rvm gemset use '#{gemset}'"
56
+ end
57
+ else
58
+ create_file(rvmrc_path) do
59
+ "# Generated with Simple_gemset \n" +
60
+ "rvm gemset create '#{gemset}'\n" +
61
+ "rvm gemset use '#{gemset}'"
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ Simple_gemset.start
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: simple_gemset
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.1
6
+ platform: ruby
7
+ authors:
8
+ - Gonzalo Rodriguez-Baltanas Diaz
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2011-07-19 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: rspec
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ type: :development
26
+ version_requirements: *id001
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ prerelease: false
30
+ requirement: &id002 !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: "0"
36
+ type: :development
37
+ version_requirements: *id002
38
+ - !ruby/object:Gem::Dependency
39
+ name: wrong
40
+ prerelease: false
41
+ requirement: &id003 !ruby/object:Gem::Requirement
42
+ none: false
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: "0"
47
+ type: :development
48
+ version_requirements: *id003
49
+ - !ruby/object:Gem::Dependency
50
+ name: thor
51
+ prerelease: false
52
+ requirement: &id004 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ type: :runtime
59
+ version_requirements: *id004
60
+ description: Generator for simple and agile .rvmrc files
61
+ email: siotopo@gmail.com
62
+ executables:
63
+ - simple_gemset
64
+ extensions: []
65
+
66
+ extra_rdoc_files: []
67
+
68
+ files:
69
+ - bin/simple_gemset
70
+ has_rdoc: true
71
+ homepage: https://github.com/nerian/simple_gemset
72
+ licenses: []
73
+
74
+ post_install_message:
75
+ rdoc_options: []
76
+
77
+ require_paths:
78
+ - lib
79
+ required_ruby_version: !ruby/object:Gem::Requirement
80
+ none: false
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: "0"
85
+ required_rubygems_version: !ruby/object:Gem::Requirement
86
+ none: false
87
+ requirements:
88
+ - - ">="
89
+ - !ruby/object:Gem::Version
90
+ version: "0"
91
+ requirements: []
92
+
93
+ rubyforge_project:
94
+ rubygems_version: 1.6.1
95
+ signing_key:
96
+ specification_version: 3
97
+ summary: Generator for simple and agile .rvmrc files
98
+ test_files: []
99
+