parliament-ruby 0.3.0 → 0.4.0

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: 3bd370b49ec333fb625e60117bb9d1eb21bf74ea
4
- data.tar.gz: a8de134cb9b7d7d144d2ad2383ee00589e1b8a51
3
+ metadata.gz: 28594af037be384f693b54a2b86319171df55870
4
+ data.tar.gz: 93304a061e7860dd550aaf5f3964d016419c93b2
5
5
  SHA512:
6
- metadata.gz: ef224f77a196afd1b48894a7408d3694c38aac4908fa02e4be9b38fb7afdc35f0872df9de84223b9539d70ae0fc6f6ecfb0b816cb58cfdede24b84ec039dd5bd
7
- data.tar.gz: fdcf925a31487d8291c34fd47fc5349017f04bcbe8085d63e3a2eeb2ebe9d653caac5df824a58855ec4cc92ab0b0872191c9ed13e5ac023edc5ac6f04cf33730
6
+ metadata.gz: df3e037738c1cff50f009e480c49a9c3e556d3c7ce465ec05cf93742d383d5eedd7deea1260a2abad6928c607a0557d0f4c8fe77617fe82f59ff62ddf758d5d6
7
+ data.tar.gz: 5bcb5bf0637bc0b2577573ecc324b7565aa2df6f06e5819888915ac73b35df00b3dc06cdf1b9d9cd561d77b1e6f8152251272c638927add0658684a28a4cc7d8
@@ -34,5 +34,16 @@ module Parliament
34
34
  end
35
35
  result
36
36
  end
37
+
38
+ def sort_by(*parameters)
39
+ rejected = []
40
+ grom_nodes = @nodes.dup
41
+ grom_nodes.delete_if { |node| rejected << node unless parameters.all?{ |param| node.respond_to?(param) } }
42
+ grom_nodes.sort_by! do |node|
43
+ parameters.map { |param| node.send(param) }
44
+ end
45
+
46
+ rejected.concat(grom_nodes)
47
+ end
37
48
  end
38
49
  end
@@ -1,3 +1,3 @@
1
1
  module Parliament
2
- VERSION = '0.3.0'.freeze
2
+ VERSION = '0.4.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parliament-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Rayner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-02-22 00:00:00.000000000 Z
11
+ date: 2017-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grom