trailblazer-loader 0.0.6 → 0.0.7

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: f755ff4167de7bd9d86372dc8f22c21376d79275
4
- data.tar.gz: 7454f5278ade16311382c59ac7e3fa53b3fd876d
3
+ metadata.gz: fcfd96e03897aacc8a5ceb4d3b32e2b184d9059c
4
+ data.tar.gz: 2b176fe74a75f7d94a801565a79d2b48bcff5335
5
5
  SHA512:
6
- metadata.gz: 34010c6e18015936b643d3f478c1306fecb6307b403d2aa8cf712229ef6d3b8065be9c850420a80705acfe53dc624c5670b70a36c9a6baf8a371c87886e30311
7
- data.tar.gz: 407642142a5136d250de896ab0066ea2f31611c8dffc51571e169e9913a8d22f327d393b95dd41e36d304dfd6da4573e5fd91eaee745187cb7ecad492e33714f
6
+ metadata.gz: 4c966a7ce3c44c882e8ade689493139db04375c93a0ce6681444900db62e1e56dbc8cd8765c5a1648d699b2b6664566543361087e0f756f5874ebe1da3c30849
7
+ data.tar.gz: 4306fd9543a7c0a78c19c9bc6cf50ca6bf285847b2072216e01740a77215855ec1abe21f6fa10afc4ef1f865857b335192c9c423f60b157135ebd6193d54dc3c
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.0.7
2
+
3
+ * Fix a ordering bug. Thanks @Hermanverschooten.
4
+
1
5
  # 0.0.6
2
6
 
3
7
  * Allow injection of additional files in `Loader::ConceptFiles` from earlier functions.
@@ -14,19 +14,18 @@ module Trailblazer
14
14
  pipeline = options[:pipeline] || Pipeline[
15
15
  FindDirectories,
16
16
  FindConcepts,
17
- # PrintConcepts,
18
17
  SortByLevel,
19
18
  Pipeline::Collect[ConceptName, ConceptFiles, SortCreateFirst, SortOperationLast, AddConceptFiles] # per concept.
20
19
  ]
21
20
 
22
21
  if args = options[:insert] # FIXME: this only implements a sub-set.
23
22
  # pipeline = Representable::Pipeline::Insert.(pipeline, *args) # FIXME: implement :before in Pipeline.
24
- pipeline[3].insert(pipeline[3].index(args.last[:before]), args.first)
23
+ pipeline.last.insert(pipeline.last.index(args.last[:before]), args.first)
25
24
  end
26
25
 
27
26
  files = pipeline.([], options).flatten
28
27
 
29
- pp files
28
+ pp files if ENV['RACK_ENV'] == 'development'
30
29
 
31
30
  load_files(files, &block)
32
31
  end
@@ -56,7 +55,7 @@ module Trailblazer
56
55
  end
57
56
 
58
57
  # operation files should be loaded after callbacks, policies, and the like: [callback.rb, contract.rb, policy.rb, operation.rb]
59
- SortOperationLast = ->(input, options) { input.sort { |a, b| (a =~ /operation/ && b !~ /operation/) ? 1 : -1 } }
58
+ SortOperationLast = ->(input, options) { input.sort { |a, b| a =~ /operation/ && b !~ /operation/ ? 1 : a !~ /operation/ && b =~ /operation/ ? 0 : a <=> b } }
60
59
  SortCreateFirst = ->(input, options) { input.sort }
61
60
  AddConceptFiles = ->(input, options) { input }
62
61
 
@@ -1,5 +1,5 @@
1
1
  module Trailblazer
2
2
  class Loader
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trailblazer-loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Sutterer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-25 00:00:00.000000000 Z
11
+ date: 2016-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler