ood_appkit 0.3.0 → 0.3.1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6fbe94cce7c92a5b9ccf234d59a65c42a25af6d
4
- data.tar.gz: 48b20a943231ce1ddcd150d482a9c84ede36a22d
3
+ metadata.gz: 9d340f86f9f789a9b3734ed32122c4d07ee1e435
4
+ data.tar.gz: b98f8a153e6f6838524c3bd31c42d840736a00fc
5
5
  SHA512:
6
- metadata.gz: e2b6601dbd55a03f526802e8c88e9104dbf43939b49fc10c09b649e5d23143d858c5b2520e6b3993f743fe33fdc394f55f0b6582304ce3d28fd45bee0e3355a0
7
- data.tar.gz: f4052ec287e187c7c7469309c60aa7a40193538cf1b0306bedb0ac9efc7caf23fc42f1a8a1cd0824470d4a596946587f8d70682f7ad9829d4ae72ec18cc32dde
6
+ metadata.gz: c52000abc27ec403f4f908f8434ef466139d6408294dd5eef3ddf3f2d7948cd7ddff58326b2bc0a2bcfd901a0823a3dc102da2482c56d7a2287596698797f497
7
+ data.tar.gz: 24768570fcde9938b3fdaeac0950cdc778057048a03f761ca3792a2908e6d84af801590097e78be10c072c072cecb009842d683f46d90ec46e0ca21d7d713260
data/README.md CHANGED
@@ -541,10 +541,32 @@ Depending on the type of server chosen, different helper methods will be
541
541
  available to the developer. You can find more details on this at
542
542
  https://github.com/OSC/ood_cluster.
543
543
 
544
- #### Reservations
544
+ #### Validations
545
545
 
546
- If reservations are supported for the chosen cluster, then a cluster object can
547
- be used to query reservation information for the current user:
546
+ A cluster may support more validations than whether the current user can access
547
+ it. The extra validations are defined in the configuration YAML file as such:
548
+
549
+ ```yaml
550
+ validators:
551
+ cluster:
552
+ - type: "OodAppkit::Validators::Groups"
553
+ data:
554
+ groups:
555
+ - "ruby"
556
+ allow: true
557
+ rsv_query:
558
+ - type: "OodAppkit::Validators::Groups"
559
+ data:
560
+ groups:
561
+ - "sysp"
562
+ - "hpcsoft"
563
+ allow: false
564
+ ```
565
+
566
+ where the key is used in the `OodAppkit::ClusterDecorator#valid?` method.
567
+
568
+ One such validation is whether the current user can query their reservation
569
+ information for the given cluster:
548
570
 
549
571
  ```ruby
550
572
  # Check if reservation query object is valid (am I allowed to use it)
@@ -552,17 +574,9 @@ be used to query reservation information for the current user:
552
574
  # view ALL reservations. This can cause the app to hang.
553
575
  my_cluster.valid?(:rsv_query) #=> true
554
576
 
555
- # Get reservation query object
556
- my_rsv_query = my_cluster.rsv_query
557
- #=> #<OodReservations::Queries::TorqueMoab>
558
-
559
- # Try to get reservation query object from cluster that doesn't support
560
- # reservations
561
- cluster_with_no_rsvs.rsv_query
562
- #=> nil
563
-
564
- # Get all reservations I have on this cluster
565
- my_rsv_query.reservations
577
+ # I am allowed to use it so let's query for user's reservations
578
+ require 'ood_reservations'
579
+ my_rsv_query = OodReservations::Query.build(cluster: my_cluster).reservations
566
580
  #=> [ #<OodReservations::Reservation>, ... ]
567
581
  ```
568
582
 
@@ -37,12 +37,6 @@ module OodAppkit
37
37
  @validators.fetch(method.to_sym, []).all? { |v| v.success? }
38
38
  end
39
39
 
40
- # A reservation query object used to query reservations for current user
41
- # @return [OodReservations::Query,nil] reservation query object
42
- def rsv_query
43
- OodReservations::Query.build(cluster: self)
44
- end
45
-
46
40
  # The comparison operator
47
41
  # @param other [#to_sym] object to compare against
48
42
  # @return [Boolean] whether objects are equivalent
@@ -1,4 +1,4 @@
1
1
  module OodAppkit
2
2
  # The current version of OodAppkit
3
- VERSION = "0.3.0"
3
+ VERSION = "0.3.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ood_appkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Franz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-30 00:00:00.000000000 Z
11
+ date: 2016-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -58,20 +58,6 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '0.0'
61
- - !ruby/object:Gem::Dependency
62
- name: ood_reservations
63
- requirement: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '0.0'
68
- type: :runtime
69
- prerelease: false
70
- version_requirements: !ruby/object:Gem::Requirement
71
- requirements:
72
- - - "~>"
73
- - !ruby/object:Gem::Version
74
- version: '0.0'
75
61
  - !ruby/object:Gem::Dependency
76
62
  name: addressable
77
63
  requirement: !ruby/object:Gem::Requirement