role_playing 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -82,6 +82,22 @@ Please read the specs for a better understanding. Also please look up DCI (data,
82
82
  Theres an Rspec extension included which basically aliases Rspecs context to role so the language used in Rspec can be closer to DCI when testing these things.
83
83
  To use that extension just do require 'role_playing/rspec_role' in your spec_helper. Look at the specs in this gem to see what I mean.
84
84
 
85
+ ## Rails
86
+
87
+ Theres a Railtie that adds autoloading of directory "contexts", the idea is to put all contexts and roles in there (roles are defined within the surrounding
88
+ context in the same file).
89
+
90
+ The structure would look like:
91
+
92
+ app/
93
+ assets/
94
+ -> contexts/
95
+ controllers/
96
+ helpers/
97
+ models/
98
+ ...
99
+
100
+
85
101
  ## Links
86
102
 
87
103
  http://dci-in-ruby.info
@@ -0,0 +1,4 @@
1
+ module RolePlaying #:nodoc:
2
+ class Engine < ::Rails::Engine #:nodoc:
3
+ end
4
+ end
@@ -0,0 +1,9 @@
1
+ require 'rails'
2
+
3
+ module RolePlaying
4
+ class Railtie < ::Rails::Railtie #:nodoc:
5
+ initializer 'role_playing.configure_rails_initialization' do |app|
6
+ config.autoload_paths += %W(#{config.root}/app/contexts)
7
+ end
8
+ end
9
+ end
@@ -1,3 +1,3 @@
1
1
  module RolePlaying
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: role_playing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -74,6 +74,8 @@ files:
74
74
  - lib/role_playing.rb
75
75
  - lib/role_playing/context.rb
76
76
  - lib/role_playing/core_ext.rb
77
+ - lib/role_playing/engine.rb
78
+ - lib/role_playing/railtie.rb
77
79
  - lib/role_playing/role.rb
78
80
  - lib/role_playing/rspec_role.rb
79
81
  - lib/role_playing/version.rb