trailblazer-rails 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 01e3a04b3c86bbaf621c3ff2cc6c40df7f4788af
4
- data.tar.gz: 7c808e6a1176e12078ed80371867f5585b601824
3
+ metadata.gz: 4163602857c7fccc8c5b5020b2e158bfc9ef7180
4
+ data.tar.gz: b241c68e7bcf9e150c44ce7f1b76e2da0fa590a3
5
5
  SHA512:
6
- metadata.gz: df485f98a78078cabd8711646c88a051fe67a90ba514c5534da0e5fa8556556abfbf9d719c6e6fb0e8fbd2465b314342362f7352d6b936abb774faaab00e3360
7
- data.tar.gz: 566fced4a3077db36782dbefda2536f310517fdbbb6ab6365b53e3856a242f11880da5a720c2b5510e21e1a9c9957a72abf295163cffb296532b4488ba534a67
6
+ metadata.gz: 1e4cce8c6b4019ee469846df195cc6e026b2c92a1db171d3949ab38c83a272e604f5f881d2e959977ec8f0fb304b025611f1fcf95d241c3d1620a228878e4ac2
7
+ data.tar.gz: afa31ea710f3e707f672aa524d717ce9fb58a7399931031ad160a760f01148ab2b8a258594acc225799451092838e3de64cdd6143dd7f87333cfdf073cf265f3
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ # 0.2.2
2
+
3
+ * Remove cells loading code, this happens via trailblazer-loader now.
4
+ * We now load the concept's model file if it exists.
5
+
1
6
  # 0.2.1
2
7
 
3
8
  * Require `trailblazer-loader`.
@@ -3,14 +3,8 @@ require "trailblazer/loader"
3
3
 
4
4
  module Trailblazer
5
5
  class Railtie < ::Rails::Railtie
6
- def self.autoload_operations(app)
7
- Loader.new.(app.root) { |file| require_dependency(file) }
8
- end
9
-
10
- def self.autoload_cells(app)
11
- Dir.glob("app/concepts/**/*cell.rb") do |f|
12
- require_dependency "#{app.root}/#{f}" # load app/concepts/{concept}/cell.rb.
13
- end
6
+ def self.load_concepts(app)
7
+ Loader.new.(insert: [ModelFile, before: Loader::ConceptFiles]) { |file| require_dependency("#{app.root}/#{file}") }
14
8
  end
15
9
 
16
10
  # This is to autoload Operation::Dispatch, etc. I'm simply assuming people find this helpful in Rails.
@@ -23,8 +17,7 @@ module Trailblazer
23
17
  # the trb autoloading has to be run after initializers have been loaded, so we can tweak inclusion of features in
24
18
  # initializers.
25
19
  ActionDispatch::Reloader.to_prepare do
26
- Trailblazer::Railtie.autoload_operations(app)
27
- Trailblazer::Railtie.autoload_cells(app)
20
+ Trailblazer::Railtie.load_concepts(app)
28
21
  end
29
22
  end
30
23
 
@@ -35,5 +28,11 @@ module Trailblazer
35
28
  initializer "trailblazer.application_controller" do
36
29
  require "trailblazer/rails/application_controller"
37
30
  end
31
+
32
+ # Prepend model file, before the concept files like operation.rb get loaded.
33
+ ModelFile = ->(input, options) do
34
+ model = "app/models/#{options[:name]}.rb"
35
+ File.exist?(model) ? [model]+input : input
36
+ end
38
37
  end
39
38
  end
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  module Rails
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency "trailblazer", ">= 1.0.4"
21
- spec.add_dependency "trailblazer-loader", ">= 0.0.1"
21
+ spec.add_dependency "trailblazer-loader", ">= 0.0.2"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.10"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-14 00:00:00.000000000 Z
11
+ date: 2015-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: trailblazer
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.1
33
+ version: 0.0.2
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.1
40
+ version: 0.0.2
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement