institutions 0.0.4 → 0.0.5

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 ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NTEyNzY5MDg5YzJhN2MxZTllM2M0NWNkZjY4OTQwNGM2NTJjNzM4YQ==
5
+ data.tar.gz: !binary |-
6
+ ZDdjZTE4ZWYwNmQzYWFjZDM1ZDgwZDYyYWE4Mjk3YWI0ZmIyYWNhNw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NTE1MDMzYTY5NzYyNjZmNDExNzAzMjhlMDJlYmMwYjMxYjY1MjhhMzZjMmI3
10
+ M2NkMmMxNTlhZjgzM2Q1MzM0YTM4ZmE1MWNlOTEzY2JhZjI2MzI2MjJmYjgy
11
+ Y2JlM2JlMDg0NTU5NzMzZjQ4MzUxNGFmYWI5NjJhZDlkMTQyZDU=
12
+ data.tar.gz: !binary |-
13
+ ZDk2MmU4MWFmNjEzYzM4ZTlmNzhkZWVhMjI5OTI2OGM3YzYxMWFmMjFhYjY3
14
+ MDA0Y2ZiN2IwYjMwMjdkZTg0N2NlNjljNGMzOTY2YWY2OGNkNzgzODcxNTJi
15
+ M2YxZGY4MWRjMTA3OThmMjYyMWMzMDhmMTdmNjIyMGFjYjAyYWI=
data/README.rdoc CHANGED
@@ -1,5 +1,5 @@
1
1
  = Institutions
2
- {<img src="https://secure.travis-ci.org/scotdalton/institutions.png?branch=master" alt="Build Status" />}[https://travis-ci.org/scotdalton/institutions]
2
+ {<img src="https://api.travis-ci.org/scotdalton/institutions.png?branch=master" alt="Build Status" />}[https://travis-ci.org/scotdalton/institutions]
3
3
  {<img src="https://gemnasium.com/scotdalton/institutions.png" alt="Dependency Status" />}[https://gemnasium.com/scotdalton/institutions]
4
4
  {<img src="https://codeclimate.com/badge.png" alt="Code Climage" />}[https://codeclimate.com/github/scotdalton/institutions]
5
5
 
@@ -20,4 +20,29 @@ Specify additional directories to search for institutional YAMLs.
20
20
  === Setting file name
21
21
  Specify additional YAML file names that contain institutions.
22
22
  require 'institutions'
23
- Institutions.filenames << "my_institution.yml"
23
+ Institutions.filenames << "my_institution.yml"
24
+
25
+ == Institution attributes
26
+ Institutions have a number of attributes available, separated
27
+ into logical modules
28
+ === Core
29
+ +code+:: +String+ of unique code for the institution (*required*)
30
+ +name+:: +String+ of user friendly name for the institution (*required*)
31
+ +default+:: +Boolean+ indicating if this is a default institution
32
+
33
+ === Auth
34
+ +auth+:: +Hash+ of attributes for an authentication/authorization system
35
+
36
+ === Ip Addresses
37
+ +ip_addresses+:: +Array+ of ip addresses for the institution
38
+
39
+ === MVC
40
+ +models+:: +Hash+ of attributes for models in an MVC application
41
+ +views+:: +Hash+ of attributes for views in an MVC application
42
+ +controllers+:: +Hash+ of attributes for controllers in an MVC application
43
+
44
+ === Parents
45
+ +parent_code+:: +String+ of code representing the institution's parent
46
+
47
+ === Services
48
+ +services+:: +Hash+ of services for the given institution
@@ -22,7 +22,7 @@ module Institutions#:no_doc
22
22
  #
23
23
  def method_missing(method, *args, &block)
24
24
  instance_variable = instance_variablize(method)
25
- if instance_variable_defined? instance_variable
25
+ if respond_to_missing?(method) and instance_variable_defined?(instance_variable)
26
26
  self.class.send :attr_reader, method.to_sym
27
27
  instance_variable_get instance_variable
28
28
  else
@@ -46,7 +46,7 @@ module Institutions#:no_doc
46
46
  end
47
47
 
48
48
  def valid_instance_variable?(id)
49
- id.to_sym.id2name.match(/[\@\=\?+]/).nil?
49
+ id.to_sym.id2name.match(/[\@\=\?+\[\]]/).nil?
50
50
  end
51
51
 
52
52
  # Convert s to an instance variable
@@ -1,3 +1,3 @@
1
1
  module Institutions
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/institutions.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  # Order of paths, then order of files dictates overrides.
2
2
 
3
3
  module Institutions
4
+ require 'yaml'
5
+ require 'erb'
4
6
  require 'require_all'
5
7
  require_rel 'institutions'
6
8
 
@@ -71,7 +73,7 @@ module Institutions
71
73
  @institutions = {}
72
74
  loadfiles.each do |loadfile|
73
75
  # Loop through institutions in the yaml
74
- YAML.load_file(loadfile).each_pair do |code, elements|
76
+ YAML.load(ERB.new(File.read(loadfile)).result).each_pair do |code, elements|
75
77
  code = code.to_sym
76
78
  # Merge the new elements or add a new Institution
77
79
  @institutions.has_key?(code) ?
@@ -9,11 +9,11 @@
9
9
  # or source-generated docs for more info.
10
10
  default:
11
11
  auth:
12
- link_code: NYU
12
+ link_code: <%= nyu = "NYU" %>
13
13
  views:
14
14
  dir: nyu
15
15
  sfx_base_url: http://sfx.library.nyu.edu/sfxlcl41?
16
- NYU:
16
+ <%= nyu %>:
17
17
  name: NYU Libraries
18
18
  parent_code: default
19
19
  ip_addresses:
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: institutions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Scot Dalton
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-13 00:00:00.000000000 Z
11
+ date: 2013-03-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: require_all
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: ipaddr_range_set
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ~>
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ~>
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: git
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ~>
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ~>
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: rdoc
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: rake
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :runtime
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -131,33 +120,26 @@ files:
131
120
  - test/test_helper.rb
132
121
  homepage: https://github.com/scotdalton/institutions
133
122
  licenses: []
123
+ metadata: {}
134
124
  post_install_message:
135
125
  rdoc_options: []
136
126
  require_paths:
137
127
  - lib
138
128
  required_ruby_version: !ruby/object:Gem::Requirement
139
- none: false
140
129
  requirements:
141
130
  - - ! '>='
142
131
  - !ruby/object:Gem::Version
143
132
  version: '0'
144
- segments:
145
- - 0
146
- hash: -3867727606638988063
147
133
  required_rubygems_version: !ruby/object:Gem::Requirement
148
- none: false
149
134
  requirements:
150
135
  - - ! '>='
151
136
  - !ruby/object:Gem::Version
152
137
  version: '0'
153
- segments:
154
- - 0
155
- hash: -3867727606638988063
156
138
  requirements: []
157
139
  rubyforge_project:
158
- rubygems_version: 1.8.24
140
+ rubygems_version: 2.0.3
159
141
  signing_key:
160
- specification_version: 3
142
+ specification_version: 4
161
143
  summary: Abstract mechanism for setting up Institutions (whatever that means).
162
144
  test_files:
163
145
  - test/config/institutions.yml