wagons 0.0.1 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +1 -1
- data/README.rdoc +135 -9
- data/Rakefile +13 -5
- data/lib/generators/wagon/templates/%singular_name%.gemspec.tt +0 -2
- data/lib/generators/wagon/templates/.gitignore +5 -0
- data/lib/generators/wagon/templates/Gemfile.tt +5 -9
- data/lib/generators/wagon/templates/app/assets/images/.empty_directory +0 -0
- data/lib/generators/wagon/templates/app/controllers/.empty_directory +0 -0
- data/lib/generators/wagon/templates/app/models/.empty_directory +0 -0
- data/lib/generators/wagon/templates/app/views/.empty_directory +0 -0
- data/lib/generators/wagon/templates/db/fixtures/development/.empty_directory +0 -0
- data/lib/generators/wagon/templates/db/migrate/.empty_directory +0 -0
- data/lib/generators/wagon/templates/lib/%singular_name%/wagon.rb.tt +7 -4
- data/lib/generators/wagon/templates/test/fixtures/.empty_directory +0 -0
- data/lib/generators/wagon/wagon_generator.rb +23 -4
- data/lib/tasks/wagons.rake +119 -20
- data/lib/wagons/extensions/application.rb +14 -0
- data/lib/wagons/extensions/require_optional.rb +9 -0
- data/lib/wagons/{test_case.rb → extensions/test_case.rb} +4 -1
- data/lib/wagons/installer.rb +313 -0
- data/lib/wagons/railtie.rb +1 -1
- data/lib/wagons/version.rb +1 -1
- data/lib/wagons/view_helper.rb +58 -0
- data/lib/wagons/wagon.rb +125 -109
- data/lib/wagons/wagon_tasks.rake +9 -7
- data/lib/wagons.rb +44 -7
- data/test/dummy/Gemfile +8 -2
- data/test/dummy/Gemfile.lock +51 -48
- data/test/dummy/app/assets/javascripts/application.js +0 -2
- data/test/dummy/app/controllers/people_controller.rb +6 -0
- data/test/dummy/app/views/people/index.html.erb +6 -0
- data/test/dummy/app/views/shared/_sidebar.html.erb +3 -0
- data/test/dummy/config/initializers/wagon_app_version.rb +7 -0
- data/test/dummy/config/routes.rb +3 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/schema.rb +1 -1
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +1230 -1586
- data/test/dummy/log/test.log +6458 -1772
- data/test/dummy/test/unit/person_test.rb +6 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/pids/server.pid +1 -0
- data/test/dummy/vendor/wagons/superliner/Gemfile +1 -5
- data/test/dummy/vendor/wagons/superliner/Gemfile.lock +46 -48
- data/test/dummy/vendor/wagons/superliner/app/controllers/cities_controller.rb +6 -0
- data/test/dummy/vendor/wagons/superliner/app/views/cities/index.html.erb +7 -0
- data/test/dummy/vendor/wagons/superliner/app/views/people/_list_superliner.html.erb +3 -0
- data/test/dummy/vendor/wagons/superliner/app/views/shared/_sidebar_superliner.html.erb +1 -0
- data/test/dummy/vendor/wagons/superliner/config/routes.rb +1 -1
- data/test/dummy/vendor/wagons/superliner/db/migrate/{20120606125258_create_cities.rb → 20120606125058_create_cities.rb} +0 -0
- data/test/dummy/vendor/wagons/superliner/dummy_superliner.gemspec +0 -2
- data/test/dummy/vendor/wagons/superliner/lib/dummy_superliner/wagon.rb +3 -1
- data/test/dummy/vendor/wagons/superliner/test/functionals/cities_controller_test.rb +12 -0
- data/test/dummy/vendor/wagons/superliner/test/functionals/people_controller_test.rb +14 -0
- data/test/dummy/vendor/wagons/superliner/test/unit/city_test.rb +4 -1
- data/test/dummy/vendor/wagons/superliner/test/wagon_test.rb +7 -5
- data/test/wagons_installer_test.rb +225 -0
- metadata +241 -169
- data/test/dummy/dummy.gemspec +0 -17
data/lib/wagons.rb
CHANGED
@@ -2,14 +2,51 @@ require 'seed-fu-ndo'
|
|
2
2
|
|
3
3
|
require 'wagons/wagon'
|
4
4
|
require 'wagons/railtie'
|
5
|
-
require 'wagons/
|
5
|
+
require 'wagons/installer'
|
6
|
+
require 'wagons/view_helper'
|
7
|
+
require 'wagons/version'
|
6
8
|
|
9
|
+
require 'wagons/extensions/application'
|
10
|
+
require 'wagons/extensions/require_optional'
|
11
|
+
require 'wagons/extensions/test_case'
|
12
|
+
|
13
|
+
|
14
|
+
# Utility class to find single wagons and provide additional information
|
15
|
+
# about the main application.
|
7
16
|
module Wagons
|
17
|
+
# All wagons installed in the current Rails application.
|
18
|
+
def self.all
|
19
|
+
Rails.application.railties.all.select {|r| r.is_a?(Wagon) }
|
20
|
+
end
|
21
|
+
|
22
|
+
# Find a wagon by its name.
|
23
|
+
def self.find(name)
|
24
|
+
name = name.to_s
|
25
|
+
all.find {|wagon| wagon.wagon_name == name || wagon.gem_name == name }
|
26
|
+
end
|
27
|
+
|
28
|
+
# The name of the main Rails application.
|
29
|
+
# By default, this is the underscored name of the application module.
|
30
|
+
# This name is directly used for the gem names,
|
31
|
+
def self.app_name
|
32
|
+
@app_name ||= Rails.application.class.name.split('::').first.underscore
|
33
|
+
end
|
34
|
+
|
35
|
+
# Set the application name. Should be lowercase with underscores.
|
36
|
+
# Do this in an initializer.
|
37
|
+
def self.app_name=(name)
|
38
|
+
@app_name = name
|
39
|
+
end
|
40
|
+
|
41
|
+
# The version of the main application.
|
42
|
+
def self.app_version
|
43
|
+
@app_version ||= Gem::Version.new("0")
|
44
|
+
end
|
45
|
+
|
46
|
+
# Set the version of the main application.
|
47
|
+
# Do this in an initializer.
|
48
|
+
def self.app_version=(version)
|
49
|
+
@app_version = version.is_a?(Gem::Version) ? version : Gem::Version.new(version)
|
50
|
+
end
|
8
51
|
end
|
9
52
|
|
10
|
-
# Requires the specified argument but silently ignores an LoadErrors.
|
11
|
-
def optional_require(*args)
|
12
|
-
require *args
|
13
|
-
rescue LoadError
|
14
|
-
# that's fine, it's an optional require
|
15
|
-
end
|
data/test/dummy/Gemfile
CHANGED
@@ -1,8 +1,14 @@
|
|
1
1
|
source "http://rubygems.org"
|
2
2
|
|
3
|
-
|
3
|
+
gem 'wagons', :path => File.expand_path(__FILE__).split("test#{File::SEPARATOR}dummy").first
|
4
4
|
|
5
|
-
|
5
|
+
group :development, :test do
|
6
|
+
gem 'sqlite3'
|
7
|
+
end
|
8
|
+
|
9
|
+
group :test do
|
10
|
+
gem 'mocha', :require => false
|
11
|
+
end
|
6
12
|
|
7
13
|
# Include the wagons you want attached in Wagonfile.
|
8
14
|
# Do not check Wagonfile into source control.
|
data/test/dummy/Gemfile.lock
CHANGED
@@ -1,85 +1,86 @@
|
|
1
1
|
PATH
|
2
|
-
remote:
|
2
|
+
remote: /Users/pascal/Code/ruby/wagons
|
3
3
|
specs:
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
wagons (0.0.9)
|
5
|
+
bundler (>= 1.1)
|
6
|
+
rails (>= 3.2)
|
7
|
+
seed-fu-ndo (>= 0.0.2)
|
7
8
|
|
8
9
|
PATH
|
9
|
-
remote:
|
10
|
+
remote: vendor/wagons/superliner
|
10
11
|
specs:
|
11
|
-
|
12
|
-
rails (>= 3.2.3)
|
13
|
-
seed-fu-ndo
|
12
|
+
dummy_superliner (0.0.1)
|
14
13
|
|
15
14
|
PATH
|
16
|
-
remote: vendor/wagons/
|
15
|
+
remote: vendor/wagons/test_wagon
|
17
16
|
specs:
|
18
|
-
|
19
|
-
dummy
|
17
|
+
dummy_test_wagon (0.0.1)
|
20
18
|
|
21
19
|
GEM
|
22
20
|
remote: http://rubygems.org/
|
23
21
|
specs:
|
24
|
-
actionmailer (3.2.
|
25
|
-
actionpack (= 3.2.
|
22
|
+
actionmailer (3.2.8)
|
23
|
+
actionpack (= 3.2.8)
|
26
24
|
mail (~> 2.4.4)
|
27
|
-
actionpack (3.2.
|
28
|
-
activemodel (= 3.2.
|
29
|
-
activesupport (= 3.2.
|
25
|
+
actionpack (3.2.8)
|
26
|
+
activemodel (= 3.2.8)
|
27
|
+
activesupport (= 3.2.8)
|
30
28
|
builder (~> 3.0.0)
|
31
29
|
erubis (~> 2.7.0)
|
32
|
-
journey (~> 1.0.
|
30
|
+
journey (~> 1.0.4)
|
33
31
|
rack (~> 1.4.0)
|
34
32
|
rack-cache (~> 1.2)
|
35
33
|
rack-test (~> 0.6.1)
|
36
34
|
sprockets (~> 2.1.3)
|
37
|
-
activemodel (3.2.
|
38
|
-
activesupport (= 3.2.
|
35
|
+
activemodel (3.2.8)
|
36
|
+
activesupport (= 3.2.8)
|
39
37
|
builder (~> 3.0.0)
|
40
|
-
activerecord (3.2.
|
41
|
-
activemodel (= 3.2.
|
42
|
-
activesupport (= 3.2.
|
38
|
+
activerecord (3.2.8)
|
39
|
+
activemodel (= 3.2.8)
|
40
|
+
activesupport (= 3.2.8)
|
43
41
|
arel (~> 3.0.2)
|
44
42
|
tzinfo (~> 0.3.29)
|
45
|
-
activeresource (3.2.
|
46
|
-
activemodel (= 3.2.
|
47
|
-
activesupport (= 3.2.
|
48
|
-
activesupport (3.2.
|
43
|
+
activeresource (3.2.8)
|
44
|
+
activemodel (= 3.2.8)
|
45
|
+
activesupport (= 3.2.8)
|
46
|
+
activesupport (3.2.8)
|
49
47
|
i18n (~> 0.6)
|
50
48
|
multi_json (~> 1.0)
|
51
49
|
arel (3.0.2)
|
52
|
-
builder (3.0.
|
50
|
+
builder (3.0.4)
|
53
51
|
erubis (2.7.0)
|
54
52
|
hike (1.2.1)
|
55
|
-
i18n (0.6.
|
56
|
-
journey (1.0.
|
57
|
-
json (1.7.
|
53
|
+
i18n (0.6.1)
|
54
|
+
journey (1.0.4)
|
55
|
+
json (1.7.5)
|
58
56
|
mail (2.4.4)
|
59
57
|
i18n (>= 0.4.0)
|
60
58
|
mime-types (~> 1.16)
|
61
59
|
treetop (~> 1.4.8)
|
62
|
-
|
63
|
-
|
60
|
+
metaclass (0.0.1)
|
61
|
+
mime-types (1.19)
|
62
|
+
mocha (0.12.3)
|
63
|
+
metaclass (~> 0.0.1)
|
64
|
+
multi_json (1.3.7)
|
64
65
|
polyglot (0.3.3)
|
65
66
|
rack (1.4.1)
|
66
67
|
rack-cache (1.2)
|
67
68
|
rack (>= 0.4)
|
68
69
|
rack-ssl (1.3.2)
|
69
70
|
rack
|
70
|
-
rack-test (0.6.
|
71
|
+
rack-test (0.6.2)
|
71
72
|
rack (>= 1.0)
|
72
|
-
rails (3.2.
|
73
|
-
actionmailer (= 3.2.
|
74
|
-
actionpack (= 3.2.
|
75
|
-
activerecord (= 3.2.
|
76
|
-
activeresource (= 3.2.
|
77
|
-
activesupport (= 3.2.
|
73
|
+
rails (3.2.8)
|
74
|
+
actionmailer (= 3.2.8)
|
75
|
+
actionpack (= 3.2.8)
|
76
|
+
activerecord (= 3.2.8)
|
77
|
+
activeresource (= 3.2.8)
|
78
|
+
activesupport (= 3.2.8)
|
78
79
|
bundler (~> 1.0)
|
79
|
-
railties (= 3.2.
|
80
|
-
railties (3.2.
|
81
|
-
actionpack (= 3.2.
|
82
|
-
activesupport (= 3.2.
|
80
|
+
railties (= 3.2.8)
|
81
|
+
railties (3.2.8)
|
82
|
+
actionpack (= 3.2.8)
|
83
|
+
activesupport (= 3.2.8)
|
83
84
|
rack-ssl (~> 1.3.2)
|
84
85
|
rake (>= 0.8.7)
|
85
86
|
rdoc (~> 3.4)
|
@@ -90,24 +91,26 @@ GEM
|
|
90
91
|
seed-fu (2.2.0)
|
91
92
|
activerecord (~> 3.1)
|
92
93
|
activesupport (~> 3.1)
|
93
|
-
seed-fu-ndo (0.0.
|
94
|
+
seed-fu-ndo (0.0.2)
|
94
95
|
seed-fu (>= 2.2.0)
|
95
96
|
sprockets (2.1.3)
|
96
97
|
hike (~> 1.2)
|
97
98
|
rack (~> 1.0)
|
98
99
|
tilt (~> 1.1, != 1.3.0)
|
99
100
|
sqlite3 (1.3.6)
|
100
|
-
thor (0.
|
101
|
+
thor (0.16.0)
|
101
102
|
tilt (1.3.3)
|
102
|
-
treetop (1.4.
|
103
|
+
treetop (1.4.12)
|
103
104
|
polyglot
|
104
105
|
polyglot (>= 0.3.1)
|
105
|
-
tzinfo (0.3.
|
106
|
+
tzinfo (0.3.34)
|
106
107
|
|
107
108
|
PLATFORMS
|
108
109
|
ruby
|
109
110
|
|
110
111
|
DEPENDENCIES
|
111
|
-
dummy!
|
112
112
|
dummy_superliner!
|
113
|
+
dummy_test_wagon!
|
114
|
+
mocha
|
115
|
+
sqlite3
|
113
116
|
wagons!
|
data/test/dummy/config/routes.rb
CHANGED
Binary file
|
data/test/dummy/db/schema.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
# This file is auto-generated from the current state of the database. Instead
|
2
3
|
# of editing this file, please use the migrations feature of Active Record to
|
3
4
|
# incrementally modify your database, and then regenerate this schema definition.
|
@@ -20,4 +21,3 @@ ActiveRecord::Schema.define(:version => 20120606125104) do
|
|
20
21
|
end
|
21
22
|
|
22
23
|
end
|
23
|
-
|
data/test/dummy/db/test.sqlite3
CHANGED
Binary file
|