railsversions 0.0.1 → 0.0.2

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 (2) hide show
  1. data/bin/railsversions +17 -2
  2. metadata +2 -2
data/bin/railsversions CHANGED
@@ -30,16 +30,31 @@ result = []
30
30
  for app in Dir.glob(File.join(APPS_DIR, '*')) do
31
31
 
32
32
  git = ''
33
- if File.file?(withgit = File.join(app, 'config', 'environment.rb'))
33
+ if File.file?(nogit3 = File.join(app, 'Gemfile'))
34
+ use3 = true
35
+ environment = File.new(nogit3).read
36
+ elsif File.file?(withgit3 = File.join(app, 'current', 'Gemfile'))
37
+ git = ' (capistrano)'
38
+ use3 = true
39
+ environment = File.new(withgit3).read
40
+ elsif File.file?(withgit = File.join(app, 'config', 'environment.rb'))
41
+ use3 = false
34
42
  environment = File.new(withgit).read
35
43
  elsif File.file?(nogit = File.join(app, 'current', 'config', 'environment.rb'))
44
+ use3 = false
36
45
  git = ' (capistrano)'
37
46
  environment = File.new(nogit).read
38
47
  else
39
48
  next
40
49
  end
41
50
 
42
- result << environment.scan(/RAILS_GEM_VERSION = '(.*)'/).to_s + ' ' + app.gsub("#{APPS_DIR}/", '') + git
51
+ if use3
52
+ gem "rails", "3.0.0.beta"
53
+ result << environment.scan(/gem.+rails.+, "(.*)"/).to_s + ' ' + app.gsub("#{APPS_DIR}/", '') + git
54
+ else
55
+ result << environment.scan(/RAILS_GEM_VERSION = '(.*)'/).to_s + ' ' + app.gsub("#{APPS_DIR}/", '') + git
56
+ end
57
+
43
58
  end
44
59
 
45
60
  puts "I found #{result.size} applications."
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 1
9
- version: 0.0.1
8
+ - 2
9
+ version: 0.0.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Captain Future