newplugin 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Manifest.txt CHANGED
@@ -12,6 +12,7 @@ generators/app/templates/init.rb
12
12
  generators/app/templates/install.rb
13
13
  generators/app/templates/lib/module.rb
14
14
  generators/app/templates/tasks/tasks.rake
15
+ generators/app/templates/test/app_root/app/controllers/application.rb
15
16
  generators/app/templates/test/app_root/app/controllers/application_controller.rb
16
17
  generators/app/templates/test/app_root/config/boot.rb
17
18
  generators/app/templates/test/app_root/config/database.yml
@@ -23,7 +23,7 @@ class AppGenerator < RubiGen::Base
23
23
  m.directory path
24
24
  end
25
25
 
26
- m.template_copy_each %w(MIT-LICENSE README Rakefile init.rb install.rb uninstall.rb test/test_helper.rb test/app_root/app/controllers/application_controller.rb)
26
+ m.template_copy_each %w(MIT-LICENSE README Rakefile init.rb install.rb uninstall.rb test/test_helper.rb test/app_root/app/controllers/application_controller.rb test/app_root/app/controllers/application.rb)
27
27
  m.template "lib/module.rb","lib/#{file_name}.rb"
28
28
  m.template "tasks/tasks.rake","tasks/#{file_name}_tasks.rake"
29
29
 
@@ -0,0 +1 @@
1
+ require File.join(PLUGIN_RAILS_ROOT,'app','controllers','application_controller.rb')
@@ -1,4 +1,5 @@
1
- RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
1
+ PLUGIN_RAILS_ROOT = "#{File.dirname(__FILE__)}/.."
2
+ RAILS_ROOT = PLUGIN_RAILS_ROOT unless defined?(RAILS_ROOT)
2
3
 
3
4
  module Rails
4
5
  class << self
@@ -59,7 +60,7 @@ module Rails
59
60
  gem 'rails'
60
61
  end
61
62
  rescue Gem::LoadError => load_error
62
- $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
63
+ $stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`.)
63
64
  exit 1
64
65
  end
65
66
 
@@ -69,10 +70,10 @@ module Rails
69
70
  end
70
71
 
71
72
  def gem_version
72
- if defined? RAILS_GEM_VERSION
73
- RAILS_GEM_VERSION
74
- elsif ENV.include?('RAILS_GEM_VERSION')
75
- ENV['RAILS_GEM_VERSION']
73
+ if defined? RAILS_VERSION
74
+ RAILS_VERSION
75
+ elsif ENV.include?('RAILS_VERSION')
76
+ ENV['RAILS_VERSION']
76
77
  else
77
78
  parse_gem_version(read_environment_rb)
78
79
  end
@@ -92,7 +93,7 @@ module Rails
92
93
  end
93
94
 
94
95
  def parse_gem_version(text)
95
- $1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
96
+ $1 if text =~ /^[^#]*RAILS_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
96
97
  end
97
98
 
98
99
  private
@@ -3,4 +3,4 @@ require 'test_help'
3
3
 
4
4
  # Run the migrations
5
5
  ActiveRecord::Migration.verbose = false
6
- ActiveRecord::Migrator.migrate("#{RAILS_ROOT}/db/migrate")
6
+ ActiveRecord::Migrator.migrate("#{PLUGIN_RAILS_ROOT}/db/migrate")
data/lib/newplugin.rb CHANGED
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module Newplugin
5
- VERSION = '0.0.2'
5
+ VERSION = '0.0.3'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newplugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - ZhangJinzhu
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-02 00:00:00 +08:00
12
+ date: 2009-12-12 00:00:00 +08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -47,6 +47,7 @@ files:
47
47
  - generators/app/templates/install.rb
48
48
  - generators/app/templates/lib/module.rb
49
49
  - generators/app/templates/tasks/tasks.rake
50
+ - generators/app/templates/test/app_root/app/controllers/application.rb
50
51
  - generators/app/templates/test/app_root/app/controllers/application_controller.rb
51
52
  - generators/app/templates/test/app_root/config/boot.rb
52
53
  - generators/app/templates/test/app_root/config/database.yml