newplugin 0.0.2 → 0.0.3
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.
- data/Manifest.txt +1 -0
- data/generators/app/app_generator.rb +1 -1
- data/generators/app/templates/test/app_root/app/controllers/application.rb +1 -0
- data/generators/app/templates/test/app_root/config/boot.rb +8 -7
- data/generators/app/templates/test/test_helper.rb +1 -1
- data/lib/newplugin.rb +1 -1
- metadata +3 -2
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
|
-
|
|
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
|
|
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?
|
|
73
|
-
|
|
74
|
-
elsif ENV.include?('
|
|
75
|
-
ENV['
|
|
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 =~ /^[^#]*
|
|
96
|
+
$1 if text =~ /^[^#]*RAILS_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
|
96
97
|
end
|
|
97
98
|
|
|
98
99
|
private
|
data/lib/newplugin.rb
CHANGED
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.
|
|
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-
|
|
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
|