ucb_rails 0.0.8 → 0.0.9

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.
@@ -1,8 +1,8 @@
1
1
  module UcbRails::Admin::UsersHelper
2
2
 
3
3
  def link_to_new_user
4
- 'New User'
5
- text = image_tag('ucb_rails/glyphicons_006_user_add.png', size: '14x14')
4
+ text = 'New User'
5
+ # text = image_tag('ucb_rails/glyphicons_006_user_add.png', size: '14x14')
6
6
  button(text, :primary,
7
7
  class: 'ldap-person-search',
8
8
  data: {
@@ -11,6 +11,7 @@ module UcbRails
11
11
  def configure
12
12
  configure_host
13
13
  authenticate
14
+ test_entries
14
15
  end
15
16
 
16
17
  private
@@ -24,11 +25,19 @@ module UcbRails
24
25
  UCB::LDAP.authenticate config['username'], config['password']
25
26
  end
26
27
  end
27
-
28
+
29
+ def test_entries
30
+ UCB::LDAP::Person.include_test_entries = config.fetch('include_test_entries', default_include_test_entries)
31
+ end
32
+
28
33
  def default_host
29
34
  RailsEnvironment.production? ? 'nds.berkeley.edu' : 'nds-test.berkeley.edu'
30
35
  end
31
36
 
37
+ def default_include_test_entries
38
+ RailsEnvironment.not_production?
39
+ end
40
+
32
41
  class << self
33
42
  def configure(config)
34
43
  new(config).configure
@@ -1,7 +1,5 @@
1
1
  %h1 Configuration
2
- = image_tag('ucb_rails/glyphicons_002_dog.png', size: '14x14')
3
- = image_tag('ucb_rails/glyphicons_006_user_add.png')
4
- = image_tag('ucb_rails/glyphicons_013_beach_umbrella.png')
2
+
5
3
  %h2 config/config.yml
6
4
 
7
5
  - config = UcbRails::Configuration::Configuration.new
@@ -6,6 +6,8 @@
6
6
  # host: 'nds-test.berkeley.edu'
7
7
  # username: <username>
8
8
  # password: <password>
9
+ # include_test_entries: true
10
+ # include_test_entries: false
9
11
 
10
12
  development:
11
13
 
@@ -53,6 +55,10 @@ development:
53
55
  # host: 'nds-test.berkeley.edu'
54
56
  # username: <username>
55
57
  # password: <password>
58
+ # # by default test entries returned in all but PROD
59
+ # include_test_entries: true
60
+ # include_test_entries: false
61
+
56
62
 
57
63
  test:
58
64
  email:
@@ -1,3 +1,3 @@
1
1
  module UcbRails
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucb_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-26 00:00:00.000000000 Z
12
+ date: 2013-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails