wagons 0.7.0 → 0.8.0

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/README.rdoc DELETED
@@ -1,147 +0,0 @@
1
- = Here Be Wagons
2
-
3
- {<img src="https://github.com/codez/wagons/actions/workflows/build.yml/badge.svg" />}[https://github.com/codez/wagons/actions/workflows/build.yml]
4
- {<img src="https://api.codeclimate.com/v1/badges/32a0d860544681cf718c/maintainability" />}[https://codeclimate.com/github/codez/wagons/maintainability]
5
-
6
- Wagons are extensions to your application train running on Rails. You can see them as plugins that
7
- extend the behavior of your specific Rails application. This framework makes it easy to create and
8
- manage them.
9
-
10
- First of all, wagons are basically {Rails Engines}[http://api.rubyonrails.org/classes/Rails/Engine.html],
11
- so make sure you are familiar with them. Wagons provide a handful of additions so your wagon
12
- engines actually know your application.
13
-
14
- Wagons differ from engines in a few points:
15
-
16
- * Wagons extend your application, engines extend Rails.
17
- * Wagon migrations are kept separately from your application's migrations to enable easy addition and removal of wagons.
18
- * When developing and testing, wagons use the main application instead of a dummy application.
19
-
20
- == Setup
21
-
22
- As always, add this declaration to your application's Gemfile:
23
-
24
- gem 'wagons'
25
-
26
- Now you are ready for your first wagon. Generate it with
27
-
28
- rails generate wagon [name]
29
-
30
- This creates the structure of your wagon in <tt>vendor/wagons/[name]</tt>. In there, you find the file <tt>lib/[name]/wagon.rb</tt>,
31
- which defines the <tt>Rails::Engine</tt> and includes the +Wagon+ module. Here, you may also extend your application
32
- classes in a +config.to_prepare+ block.
33
-
34
- In order to load wagons with the application, an entry in the +Gemfile+ would be sufficient.
35
- To keep things flexible, wagons come with an additional file +Wagonfile+. Generate one for development purposes with:
36
-
37
- rake wagon:file
38
-
39
- This will include all wagons found in +vendor/wagons+ in development mode.
40
- Do not check +Wagonfile+ into source control. In your deployments, you might want to have different entries in there.
41
-
42
- Once your wagon is ready to ship, a gem can be built with <tt>rake build</tt>. The name of a wagon gem must always start
43
- with the application name, followed with an underscore and the actual name of the wagon. In production, you may
44
- simply install the wagon gem and explicitly add a declaration to your +Wagonfile+.
45
-
46
- If your wagon contains migrations and probably seed data, update your database with
47
-
48
- rake wagon:setup WAGON=[name]
49
-
50
- Leave off the +WAGON+ parameter to setup all wagons in your +Wagonfile+. This should not interfere with wagons that are
51
- already set up. Migrations are only run if they are not loaded yet, as usual.
52
-
53
-
54
- == Extending your application with a wagon
55
-
56
- Ruby and Rails provide all the magic required to extend your application from within a wagon.
57
-
58
- To add new models, controllers or views, simply create them in the +app+ directory of your wagon, as you would in a regular engine.
59
-
60
- To extend existing models and controllers, you may create modules with the required functionality.
61
- Include them into your application classes in a +config.to_prepare+ block in <tt>lib/[wagon_name]/wagon.rb</tt>.
62
-
63
- To extend views, wagons provides a simple view helper that looks for partials in all view paths. Any template that
64
- might be extended by a wagon can include a call like this:
65
-
66
- <%= render_extensions :details %>
67
-
68
- Any partials living in an equally named subfolder as the calling template and starting with the given key are rendered at this place.
69
-
70
-
71
- == Wagon dependencies
72
-
73
- Wagons may depend on each other and/or have certain requirements on their load order. To make sure something
74
- is loaded before the current wagon, add a <tt>require '[app_name]_[other_wagon]'</tt> on top of the
75
- <tt>lib/[app_name]_[current_wagon].rb</tt> file. For development dependencies, there is an extra +require_optional+
76
- method that will not raise a +LoadError+ if the dependency is not found.
77
-
78
- To control that the main application actually supports a certain wagon, an application version may be defined
79
- so wagons can define a requirement. The application version can be set in an initializer. Create it with:
80
-
81
- rake wagon:app_version
82
-
83
- Besides setting the version, this initializer will check all loaded wagons for their application requirement
84
- and raise errors if one is not met. In <tt>lib/[wagon_name]/wagon.rb</tt> the requirement may be defined, e.g.:
85
-
86
- app_requirement '>= 1.0'
87
-
88
- The syntax follows the Ruby gem version and requirements.
89
-
90
-
91
- == Seed Data
92
-
93
- Wagons integrates {Seed Fu}[https://github.com/mbleigh/seed-fu] for seed data. All seed data from the application
94
- is also available in wagon tests, as long as no fixture files overwrite the corresponding tables.
95
-
96
- Wagons may come with their own seed data as well. Simply put it into <tt>db/fixtures[/environment]</tt>. To allow for
97
- an automatic removal of wagons, {Seed Fu-ndo}[https://github.com/codez/seed-fu-ndo] is able to record
98
- seed file instructions and destroy all entries that exist in the database. Just make sure that you only use
99
- the +seed+ and +seed_once+ methods in these files, or the unseed may not work correctly.
100
-
101
-
102
- == Beware
103
-
104
- There are a few other things that work differently with wagons:
105
-
106
- === Schema & Migrations
107
-
108
- Wagons are extensions to your application that may vary between various installations. Wagon tables are added
109
- and removed as wagons are installed or uninstalled. After you have added a wagon's gem to your production
110
- +Wagonfile+, run <tt>rake wagon:setup</tt> to run the migrations and load the seed data. Before you remove them
111
- from +Wagonfile+, run <tt>rake wagon:remove WAGON=to_remove</tt> to eliminate the artifacts from the database first.
112
-
113
- In this way, the +schema.rb+ file must only contain the tables of the application, not of all wagons.
114
- When you have migrations for your main application and wagons loaded, the schema will not be dumped on
115
- <tt>db:migrate</tt>. You need to either remove the wagons or reset the database before the schema may be dumped.
116
- This is (currently) the cost for having arbitrary pluggable application extensions.
117
-
118
- === Tests
119
-
120
- Wagons use your application for tests. This is also true for your application's test database. To get the
121
- correct setup, <tt>app:db:test:prepare</tt> is extended to run the migration of the current wagon and all its
122
- dependencies, as well as their seed data. Once the database is set up, single tests may be run with
123
- the usual <tt>ruby -I test test/my_test.rb</tt> command.
124
-
125
- The +test_helper.rb+ of the main application is included in all wagon tests. Any additions in
126
- this file are available in wagon tests as well. The only thing wagons need to do is reseting the
127
- fixture path to the wagon's test fixtures.
128
-
129
- RSpec works fine with wagons as well. Simply put the heading lines found in <tt>test_helper.rb</tt> into your
130
- <tt>spec_helper.rb</tt>.
131
-
132
- === Gem Bundling
133
-
134
- Bundler manages application dependencies, with a stress on application. Because wagons live
135
- inside your application during development, the app's +Gemfile+ is included in each wagon's +Gemfile+.
136
- However, Bundler still keeps a separate <tt>Gemfile.lock</tt> for each wagon, so you have to make sure to keep
137
- these up to date when you change your main application gems. The gem versions for the wagons should be
138
- the same as for the application. <tt>rake wagon:bundle:update</tt> is here to help you exactly with that.
139
- We recommend to NOT check in the Wagon's <tt>Gemfile.lock</tt> file into source control.
140
-
141
- Unfortunately, adding wagon gems to the +Wagonfile+ in production also breaks with Bundler's approach
142
- of locking down application gems. Because of that, the <tt>--deployment</tt> option cannot be used
143
- with wagons. If you install your gems from <tt>vendor/cache</tt> into <tt>vendor/bundle</tt> or so,
144
- you still get most of the benefits of using Bundler, including the guarantee for the very same gem
145
- versions as used in development.
146
-
147
- Contributions to this or any other issues are very welcome.
@@ -1,10 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path => '../..'
4
-
5
- gem 'rails', '~> 5.2.0'
6
-
7
- group :test do
8
- gem 'mocha', :require => false
9
- gem 'rails-controller-testing'
10
- end
@@ -1,142 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- wagons (0.6.1)
5
- bundler (>= 1.1)
6
- rails (>= 5.2)
7
- seed-fu-ndo (>= 0.0.3)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (5.2.8.1)
13
- actionpack (= 5.2.8.1)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- actionmailer (5.2.8.1)
17
- actionpack (= 5.2.8.1)
18
- actionview (= 5.2.8.1)
19
- activejob (= 5.2.8.1)
20
- mail (~> 2.5, >= 2.5.4)
21
- rails-dom-testing (~> 2.0)
22
- actionpack (5.2.8.1)
23
- actionview (= 5.2.8.1)
24
- activesupport (= 5.2.8.1)
25
- rack (~> 2.0, >= 2.0.8)
26
- rack-test (>= 0.6.3)
27
- rails-dom-testing (~> 2.0)
28
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.2.8.1)
30
- activesupport (= 5.2.8.1)
31
- builder (~> 3.1)
32
- erubi (~> 1.4)
33
- rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
- activejob (5.2.8.1)
36
- activesupport (= 5.2.8.1)
37
- globalid (>= 0.3.6)
38
- activemodel (5.2.8.1)
39
- activesupport (= 5.2.8.1)
40
- activerecord (5.2.8.1)
41
- activemodel (= 5.2.8.1)
42
- activesupport (= 5.2.8.1)
43
- arel (>= 9.0)
44
- activestorage (5.2.8.1)
45
- actionpack (= 5.2.8.1)
46
- activerecord (= 5.2.8.1)
47
- marcel (~> 1.0.0)
48
- activesupport (5.2.8.1)
49
- concurrent-ruby (~> 1.0, >= 1.0.2)
50
- i18n (>= 0.7, < 2)
51
- minitest (~> 5.1)
52
- tzinfo (~> 1.1)
53
- arel (9.0.0)
54
- builder (3.2.4)
55
- concurrent-ruby (1.1.10)
56
- crass (1.0.6)
57
- erubi (1.11.0)
58
- globalid (1.0.0)
59
- activesupport (>= 5.0)
60
- i18n (1.12.0)
61
- concurrent-ruby (~> 1.0)
62
- loofah (2.19.0)
63
- crass (~> 1.0.2)
64
- nokogiri (>= 1.5.9)
65
- mail (2.7.1)
66
- mini_mime (>= 0.1.1)
67
- marcel (1.0.2)
68
- method_source (1.0.0)
69
- mini_mime (1.1.2)
70
- minitest (5.16.3)
71
- mocha (1.15.0)
72
- nio4r (2.5.8)
73
- nokogiri (1.13.8-x86_64-linux)
74
- racc (~> 1.4)
75
- open4 (1.3.4)
76
- racc (1.6.0)
77
- rack (2.2.4)
78
- rack-test (2.0.2)
79
- rack (>= 1.3)
80
- rails (5.2.8.1)
81
- actioncable (= 5.2.8.1)
82
- actionmailer (= 5.2.8.1)
83
- actionpack (= 5.2.8.1)
84
- actionview (= 5.2.8.1)
85
- activejob (= 5.2.8.1)
86
- activemodel (= 5.2.8.1)
87
- activerecord (= 5.2.8.1)
88
- activestorage (= 5.2.8.1)
89
- activesupport (= 5.2.8.1)
90
- bundler (>= 1.3.0)
91
- railties (= 5.2.8.1)
92
- sprockets-rails (>= 2.0.0)
93
- rails-controller-testing (1.0.5)
94
- actionpack (>= 5.0.1.rc1)
95
- actionview (>= 5.0.1.rc1)
96
- activesupport (>= 5.0.1.rc1)
97
- rails-dom-testing (2.0.3)
98
- activesupport (>= 4.2.0)
99
- nokogiri (>= 1.6)
100
- rails-html-sanitizer (1.4.3)
101
- loofah (~> 2.3)
102
- railties (5.2.8.1)
103
- actionpack (= 5.2.8.1)
104
- activesupport (= 5.2.8.1)
105
- method_source
106
- rake (>= 0.8.7)
107
- thor (>= 0.19.0, < 2.0)
108
- rake (13.0.6)
109
- seed-fu (2.3.9)
110
- activerecord (>= 3.1)
111
- activesupport (>= 3.1)
112
- seed-fu-ndo (0.0.3)
113
- seed-fu (>= 2.2.0)
114
- sprockets (4.1.1)
115
- concurrent-ruby (~> 1.0)
116
- rack (> 1, < 3)
117
- sprockets-rails (3.4.2)
118
- actionpack (>= 5.2)
119
- activesupport (>= 5.2)
120
- sprockets (>= 3.0.0)
121
- sqlite3 (1.5.3-x86_64-linux)
122
- thor (1.2.1)
123
- thread_safe (0.3.6)
124
- tzinfo (1.2.10)
125
- thread_safe (~> 0.1)
126
- websocket-driver (0.7.5)
127
- websocket-extensions (>= 0.1.0)
128
- websocket-extensions (0.1.5)
129
-
130
- PLATFORMS
131
- x86_64-linux
132
-
133
- DEPENDENCIES
134
- mocha
135
- open4
136
- rails (~> 5.2.0)
137
- rails-controller-testing
138
- sqlite3
139
- wagons!
140
-
141
- BUNDLED WITH
142
- 2.3.19
@@ -1,164 +0,0 @@
1
- PATH
2
- remote: ../..
3
- specs:
4
- wagons (0.6.1)
5
- bundler (>= 1.1)
6
- rails (>= 5.2)
7
- seed-fu-ndo (>= 0.0.3)
8
-
9
- GEM
10
- remote: https://rubygems.org/
11
- specs:
12
- actioncable (6.0.6)
13
- actionpack (= 6.0.6)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- actionmailbox (6.0.6)
17
- actionpack (= 6.0.6)
18
- activejob (= 6.0.6)
19
- activerecord (= 6.0.6)
20
- activestorage (= 6.0.6)
21
- activesupport (= 6.0.6)
22
- mail (>= 2.7.1)
23
- actionmailer (6.0.6)
24
- actionpack (= 6.0.6)
25
- actionview (= 6.0.6)
26
- activejob (= 6.0.6)
27
- mail (~> 2.5, >= 2.5.4)
28
- rails-dom-testing (~> 2.0)
29
- actionpack (6.0.6)
30
- actionview (= 6.0.6)
31
- activesupport (= 6.0.6)
32
- rack (~> 2.0, >= 2.0.8)
33
- rack-test (>= 0.6.3)
34
- rails-dom-testing (~> 2.0)
35
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
36
- actiontext (6.0.6)
37
- actionpack (= 6.0.6)
38
- activerecord (= 6.0.6)
39
- activestorage (= 6.0.6)
40
- activesupport (= 6.0.6)
41
- nokogiri (>= 1.8.5)
42
- actionview (6.0.6)
43
- activesupport (= 6.0.6)
44
- builder (~> 3.1)
45
- erubi (~> 1.4)
46
- rails-dom-testing (~> 2.0)
47
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
48
- activejob (6.0.6)
49
- activesupport (= 6.0.6)
50
- globalid (>= 0.3.6)
51
- activemodel (6.0.6)
52
- activesupport (= 6.0.6)
53
- activerecord (6.0.6)
54
- activemodel (= 6.0.6)
55
- activesupport (= 6.0.6)
56
- activestorage (6.0.6)
57
- actionpack (= 6.0.6)
58
- activejob (= 6.0.6)
59
- activerecord (= 6.0.6)
60
- marcel (~> 1.0)
61
- activesupport (6.0.6)
62
- concurrent-ruby (~> 1.0, >= 1.0.2)
63
- i18n (>= 0.7, < 2)
64
- minitest (~> 5.1)
65
- tzinfo (~> 1.1)
66
- zeitwerk (~> 2.2, >= 2.2.2)
67
- builder (3.2.4)
68
- concurrent-ruby (1.1.10)
69
- crass (1.0.6)
70
- erubi (1.11.0)
71
- globalid (1.0.0)
72
- activesupport (>= 5.0)
73
- i18n (1.12.0)
74
- concurrent-ruby (~> 1.0)
75
- loofah (2.19.0)
76
- crass (~> 1.0.2)
77
- nokogiri (>= 1.5.9)
78
- mail (2.7.1)
79
- mini_mime (>= 0.1.1)
80
- marcel (1.0.2)
81
- method_source (1.0.0)
82
- mini_mime (1.1.2)
83
- minitest (5.16.3)
84
- mocha (1.15.0)
85
- net-protocol (0.1.3)
86
- timeout
87
- net-smtp (0.3.2)
88
- net-protocol
89
- nio4r (2.5.8)
90
- nokogiri (1.13.8-x86_64-linux)
91
- racc (~> 1.4)
92
- open4 (1.3.4)
93
- racc (1.6.0)
94
- rack (2.2.4)
95
- rack-test (2.0.2)
96
- rack (>= 1.3)
97
- rails (6.0.6)
98
- actioncable (= 6.0.6)
99
- actionmailbox (= 6.0.6)
100
- actionmailer (= 6.0.6)
101
- actionpack (= 6.0.6)
102
- actiontext (= 6.0.6)
103
- actionview (= 6.0.6)
104
- activejob (= 6.0.6)
105
- activemodel (= 6.0.6)
106
- activerecord (= 6.0.6)
107
- activestorage (= 6.0.6)
108
- activesupport (= 6.0.6)
109
- bundler (>= 1.3.0)
110
- railties (= 6.0.6)
111
- sprockets-rails (>= 2.0.0)
112
- rails-controller-testing (1.0.5)
113
- actionpack (>= 5.0.1.rc1)
114
- actionview (>= 5.0.1.rc1)
115
- activesupport (>= 5.0.1.rc1)
116
- rails-dom-testing (2.0.3)
117
- activesupport (>= 4.2.0)
118
- nokogiri (>= 1.6)
119
- rails-html-sanitizer (1.4.3)
120
- loofah (~> 2.3)
121
- railties (6.0.6)
122
- actionpack (= 6.0.6)
123
- activesupport (= 6.0.6)
124
- method_source
125
- rake (>= 0.8.7)
126
- thor (>= 0.20.3, < 2.0)
127
- rake (13.0.6)
128
- seed-fu (2.3.9)
129
- activerecord (>= 3.1)
130
- activesupport (>= 3.1)
131
- seed-fu-ndo (0.0.3)
132
- seed-fu (>= 2.2.0)
133
- sprockets (4.1.1)
134
- concurrent-ruby (~> 1.0)
135
- rack (> 1, < 3)
136
- sprockets-rails (3.4.2)
137
- actionpack (>= 5.2)
138
- activesupport (>= 5.2)
139
- sprockets (>= 3.0.0)
140
- sqlite3 (1.5.3-x86_64-linux)
141
- thor (1.2.1)
142
- thread_safe (0.3.6)
143
- timeout (0.3.0)
144
- tzinfo (1.2.10)
145
- thread_safe (~> 0.1)
146
- websocket-driver (0.7.5)
147
- websocket-extensions (>= 0.1.0)
148
- websocket-extensions (0.1.5)
149
- zeitwerk (2.6.1)
150
-
151
- PLATFORMS
152
- x86_64-linux
153
-
154
- DEPENDENCIES
155
- mocha
156
- net-smtp
157
- open4
158
- rails (~> 6.0.0)
159
- rails-controller-testing
160
- sqlite3
161
- wagons!
162
-
163
- BUNDLED WITH
164
- 2.3.19
@@ -1,7 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
- # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
-
6
- # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
- # Rails.backtrace_cleaner.remove_silencers!
@@ -1,15 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
6
- # inflect.plural /^(ox)$/i, '\1en'
7
- # inflect.singular /^(ox)en/i, '\1'
8
- # inflect.irregular 'person', 'people'
9
- # inflect.uncountable %w( fish sheep )
10
- # end
11
- #
12
- # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
- # inflect.acronym 'RESTful'
15
- # end
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone