rails-upgrade 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ === 0.0.1 2010-01-23
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
@@ -0,0 +1,14 @@
1
+ History.txt
2
+ Manifest.txt
3
+ PostInstall.txt
4
+ README.rdoc
5
+ Rakefile
6
+ bin/rails-upgrade
7
+ lib/rails-upgrade.rb
8
+ lib/rails-upgrade/cli.rb
9
+ script/console
10
+ script/destroy
11
+ script/generate
12
+ test/test_helper.rb
13
+ test/test_rails-upgrade.rb
14
+ test/test_rails-upgrade_cli.rb
@@ -0,0 +1,7 @@
1
+
2
+ For more information on rails-upgrade, see http://rails-upgrade.rubyforge.org
3
+
4
+ NOTE: Change this information in PostInstall.txt
5
+ You can also delete it if you don't want it.
6
+
7
+
@@ -0,0 +1,43 @@
1
+ = rails-upgrade
2
+
3
+ http://github.com/jm/rails-upgrade
4
+
5
+ == Description
6
+
7
+ A simple battery of scripts for upgrading Rails app/checking them for required updates.
8
+
9
+ == Usage
10
+
11
+ # Check your app for required upgrades
12
+ rails-upgrade check
13
+
14
+ # Generate a new route file
15
+ rails-upgrade routes
16
+
17
+ # Generate a Gemfile from your config.gem directives
18
+ rails-upgrade gems
19
+
20
+ == License
21
+
22
+ (The MIT License)
23
+
24
+ Copyright (c) 2010 Jeremy McAnally
25
+
26
+ Permission is hereby granted, free of charge, to any person obtaining
27
+ a copy of this software and associated documentation files (the
28
+ 'Software'), to deal in the Software without restriction, including
29
+ without limitation the rights to use, copy, modify, merge, publish,
30
+ distribute, sublicense, and/or sell copies of the Software, and to
31
+ permit persons to whom the Software is furnished to do so, subject to
32
+ the following conditions:
33
+
34
+ The above copyright notice and this permission notice shall be
35
+ included in all copies or substantial portions of the Software.
36
+
37
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
38
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
39
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
40
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
41
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
42
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
43
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,25 @@
1
+ require 'rubygems'
2
+ gem 'hoe', '>= 2.1.0'
3
+ require 'hoe'
4
+ require 'fileutils'
5
+ require './lib/rails-upgrade'
6
+
7
+ Hoe.plugin :newgem
8
+ # Hoe.plugin :website
9
+ # Hoe.plugin :cucumberfeatures
10
+
11
+ # Generate all the Rake tasks
12
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
13
+ $hoe = Hoe.spec 'rails-upgrade' do
14
+ self.developer 'Jeremy McAnally', 'jeremy@intridea.com'
15
+ self.post_install_message = 'PostInstall.txt' # TODO remove if post-install message not required
16
+ self.rubyforge_name = self.name
17
+ self.extra_deps = [['activesupport','>= 2.0.2'], ['term-ansicolor', '> 0.0.0']]
18
+ end
19
+
20
+ require 'newgem/tasks'
21
+ Dir['tasks/**/*.rake'].each { |t| load t }
22
+
23
+ # TODO - want other tests/tasks run by default? Add them to the list
24
+ # remove_task :default
25
+ # task :default => [:spec, :features]
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # Created by Jeremy McAnally on 2010-1-23.
4
+ # Copyright (c) 2010. All rights reserved.
5
+
6
+ require 'rubygems'
7
+ require File.expand_path(File.dirname(__FILE__) + "/../lib/rails-upgrade")
8
+ require "rails-upgrade/cli"
9
+ require 'term/ansicolor'
10
+
11
+ class String
12
+ include Term::ANSIColor
13
+ end
14
+
15
+ begin
16
+ RailsUpgrade::CLI.execute(STDOUT, ARGV)
17
+ rescue StandardError => e
18
+ puts
19
+ puts "Error: ".red + e.message.white
20
+ puts "".reset
21
+ end
@@ -0,0 +1,15 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ module RailsUpgrade
5
+ VERSION = '0.0.1'
6
+ end
7
+
8
+ require 'active_support'
9
+
10
+ require 'rails-upgrade/errors'
11
+
12
+ require 'rails-upgrade/upgraders/routes'
13
+ require 'rails-upgrade/upgraders/gems'
14
+ require 'rails-upgrade/upgraders/check'
15
+
@@ -0,0 +1,22 @@
1
+ module RailsUpgrade
2
+ class CLI
3
+ class <<self
4
+ def execute(stdout, arguments=[])
5
+ command = arguments.pop.capitalize
6
+
7
+ if RailsUpgrade::Upgraders.const_defined?(command)
8
+ klass = RailsUpgrade::Upgraders.const_get(command)
9
+ instance = klass.new
10
+
11
+ instance.upgrade!(arguments)
12
+ else
13
+ usage
14
+ end
15
+ end
16
+
17
+ def usage
18
+ puts "fail"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # File: script/console
3
+ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
+
5
+ libs = " -r irb/completion"
6
+ # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
+ libs << " -r #{File.dirname(__FILE__) + '/../lib/rails-upgrade.rb'}"
9
+ puts "Loading rails-upgrade gem"
10
+ exec "#{irb} #{libs} --simple-prompt"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/destroy'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Destroy.new.run(ARGV)
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Generate.new.run(ARGV)
@@ -0,0 +1,3 @@
1
+ require 'stringio'
2
+ require 'test/unit'
3
+ require File.dirname(__FILE__) + '/../lib/rails-upgrade'
@@ -0,0 +1,11 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class TestRailsUpgrade < Test::Unit::TestCase
4
+
5
+ def setup
6
+ end
7
+
8
+ def test_truth
9
+ flunk("HAHAHA YEAH RIGHT.")
10
+ end
11
+ end
@@ -0,0 +1,7 @@
1
+ require File.join(File.dirname(__FILE__), "test_helper.rb")
2
+ require 'rails-upgrade/cli'
3
+
4
+ class TestRailsUpgradeCli < Test::Unit::TestCase
5
+ def test_test
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,123 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails-upgrade
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jeremy McAnally
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2010-01-28 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.2
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: term-ansicolor
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.0
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rubyforge
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 2.0.3
44
+ version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: gemcutter
47
+ type: :development
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 0.3.0
54
+ version:
55
+ - !ruby/object:Gem::Dependency
56
+ name: hoe
57
+ type: :development
58
+ version_requirement:
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ version: 2.5.0
64
+ version:
65
+ description: A simple battery of scripts for upgrading Rails app/checking them for required updates.
66
+ email:
67
+ - jeremy@intridea.com
68
+ executables:
69
+ - rails-upgrade
70
+ extensions: []
71
+
72
+ extra_rdoc_files:
73
+ - History.txt
74
+ - Manifest.txt
75
+ - PostInstall.txt
76
+ files:
77
+ - History.txt
78
+ - Manifest.txt
79
+ - PostInstall.txt
80
+ - README.rdoc
81
+ - Rakefile
82
+ - bin/rails-upgrade
83
+ - lib/rails-upgrade.rb
84
+ - lib/rails-upgrade/cli.rb
85
+ - script/console
86
+ - script/destroy
87
+ - script/generate
88
+ - test/test_helper.rb
89
+ - test/test_rails-upgrade.rb
90
+ - test/test_rails-upgrade_cli.rb
91
+ has_rdoc: true
92
+ homepage: http://github.com/jm/rails-upgrade
93
+ licenses: []
94
+
95
+ post_install_message: PostInstall.txt
96
+ rdoc_options:
97
+ - --main
98
+ - README.rdoc
99
+ require_paths:
100
+ - lib
101
+ required_ruby_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: "0"
106
+ version:
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: "0"
112
+ version:
113
+ requirements: []
114
+
115
+ rubyforge_project: rails-upgrade
116
+ rubygems_version: 1.3.5
117
+ signing_key:
118
+ specification_version: 3
119
+ summary: A simple battery of scripts for upgrading Rails app/checking them for required updates.
120
+ test_files:
121
+ - test/test_helper.rb
122
+ - test/test_rails-upgrade.rb
123
+ - test/test_rails-upgrade_cli.rb