jgrouper 0.0.5 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ebdf58326f3d4603a2fa1a5c5c4c3d4fd8465d08
4
+ data.tar.gz: 8cc466039a9c092e38e258eece5d55ce79afc05f
5
+ SHA512:
6
+ metadata.gz: 7063017395e37a2e1a3dd53792568236c27d8275ca7f8d13401879fe90cec873d63c8a539cfe196dcac52c4a5bdc912699a768e582ea7cca8383540a0749e1bd
7
+ data.tar.gz: 6f115a9aa0673619b5deab7ad9d367eeca6746d8840498b5bff26659380e2d0693453f825dd376ac117f8840747e8a854218e726f1dc8de53f4948c59cd32e71
data/.autotest ADDED
@@ -0,0 +1,35 @@
1
+
2
+ Autotest.add_hook :initialize do |at|
3
+
4
+ # TODO No tests matched lib/jgrouper/group/test_case.rb
5
+ # TODO No tests matched lib/jgrouper/group_type/test_case.rb
6
+ # TODO No tests matched lib/jgrouper/stem/test_case.rb
7
+ # TODO No tests matched lib/jgrouper/subject/test_case.rb
8
+ # TODO No tests matched lib/jgrouper.rb
9
+
10
+ %w(
11
+ .autotest
12
+ .git/
13
+ .gitignore
14
+ coverage/
15
+ HISTORY.md
16
+ lib/jgrouper/version.rb
17
+ LICENSE
18
+ logs/
19
+ Rakefile
20
+ README.rdoc
21
+ TODO.md
22
+ ).each { |exception| at.add_exception(exception) }
23
+
24
+ [
25
+ %r{^Gemfile},
26
+ %r{^jgrouper\.gemspec$},
27
+ %r{^test/(?:factories|helper)\.rb$}
28
+ ].each do |rx|
29
+ at.add_mapping(rx) { |fn, _| at.files_matching( %r{^test/test_.*\.rb$} ) }
30
+ end
31
+
32
+ end
33
+
34
+ # vim: syntax=ruby
35
+
data/.gitignore CHANGED
@@ -1,5 +1,9 @@
1
+ .*.swp
2
+ *.csv
1
3
  *.gem
4
+ *.log
2
5
  *.rbc
6
+ *.sh
3
7
  .bundle
4
8
  .config
5
9
  .yardoc
@@ -8,9 +12,8 @@ InstalledFiles
8
12
  _yardoc
9
13
  coverage
10
14
  doc/
11
- html/
15
+ err.txt
12
16
  lib/bundler/man
13
- logs/
14
17
  out.txt
15
18
  pkg
16
19
  rdoc
@@ -18,4 +21,3 @@ spec/reports
18
21
  test/tmp
19
22
  test/version_tmp
20
23
  tmp
21
- .*.swp
data/Gemfile CHANGED
@@ -1,4 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ruby '1.9.3', engine: 'jruby', engine_version: '1.7.3'
4
+
3
5
  # Specify your gem's dependencies in jgrouper.gemspec
4
6
  gemspec
7
+
data/HISTORY.md CHANGED
@@ -1,6 +1,25 @@
1
1
  JGrouper History
2
2
  ================
3
3
 
4
+ 2013-05-15 JGrouper v0.1.0
5
+ --------------------------
6
+ Starting over with a more clear design in mind.
7
+
8
+ * Add "bin/jgrouper-audit-archiver"
9
+ * Add "bin/jgrouper-export"
10
+ * Add "JGrouper.home!()"
11
+ * Add "JGrouper::AuditArchiver"
12
+ * Add "JGrouper::Exporter"
13
+ * Add "JGrouper::Group"
14
+ * Add "JGrouper::Member"
15
+ * Add "JGrouper::Member.find()"
16
+ * Add "JGrouper::Stem"
17
+ * Add "JGrouper::Stem.find()"
18
+ * Add "JGrouper::Stem#groups()"
19
+ * Add "JGrouper::Stem.root()"
20
+ * Add "JGrouper::Stem#stems()"
21
+
22
+
4
23
  2012-11-20 JGrouper v0.0.5
5
24
  --------------------------
6
25
  * Add *JGrouper::Group#add_type*
@@ -12,6 +31,7 @@ JGrouper History
12
31
  * Add *JGrouper::Subject#method_missing*
13
32
  * Fix *JGrouper::Group* tests
14
33
 
34
+
15
35
  2012-10-04 JGrouper v0.0.4
16
36
  --------------------------
17
37
  * Add *JGrouper::Group*
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012 blair christensen
1
+ Copyright (c) 2013 blair christensen
2
2
 
3
3
  MIT License
4
4
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc CHANGED
@@ -7,69 +7,6 @@
7
7
  # Set path to your Grouper API installation
8
8
  JGrouper.home '/path/to/your/grouper/api/installation/directory'
9
9
 
10
- === Subjects
11
-
12
- # Find root subject
13
- JGrouper::Subject.root do |subject|
14
- subject.id # Subject identifier
15
- subject.name # Subject name
16
- subject.source # Subject source identifier
17
- subject.type # Subject type name
18
- subject.getSource # Call native Subject API methods
19
- end
20
-
21
- === Stems
22
-
23
- # Find root stem
24
- JGrouper::Stem.root do |stem|
25
- stem.display_name # Stem display name
26
- stem.name # Stem name
27
- stem.uuid # Stem UUID
28
- stem.getChildGroups # Call native Grouper API methods
29
- end
30
-
31
- # Find by name
32
- stem = JGrouper::Stem.find(name) { |stem| ... }
33
-
34
- # Create stem(s)
35
- stem = JGrouper::Stem.create 'foo:bar:baz', 'Foo:Bar:Baz'
36
-
37
- # Create child stem(s)
38
- child = stem.create 'foo:bar:baz'
39
-
40
- === Groups
41
-
42
- # Find by name
43
- group = JGrouper::Group.find(name) do |group|
44
- group.display_name # Group display name
45
- group.name # Group name
46
- group.types # Array of group type names
47
- group.uuid # Group UUID
48
- group.add_type 'group type' # Add group type
49
- group.delete_type 'group_type' # Delete group type
50
- group.getParentStem # Call native Grouper API methods
51
- end
52
-
53
- === Group Types
54
-
55
- # Create group type
56
- JGrouper::GroupType.create(name) do |group_type|
57
- group_type.name # Group type name
58
- group_type.uuid # Group type uuid
59
- group_type.getFields # Call native Grouper API methods
60
- end
61
-
62
- # Find all group types
63
- group_types = JGrouper::GroupType.all { |group_type| ... }
64
-
65
- # Find group type
66
- JGrouper::GroupType.find(name)
67
-
68
- # Delete group type
69
- JGrouper::GroupType.delete(name)
70
- # ... or ...
71
- JGrouper::GroupType.find(name).delete
72
-
73
10
  == Installation
74
11
 
75
12
  Add this line to your application's Gemfile:
@@ -98,9 +35,9 @@ blair christensen. <mailto:blair.christensen@gmail.com>
98
35
 
99
36
  == Home Page
100
37
 
101
- https://github.com/blairc/jgrouper
38
+ https://github.com/blairc/jgrouper/
102
39
 
103
40
  == See Also
104
41
 
105
- JGrouper::Shell https://github.com/blairc/jgrouper-shell, JGrouper::Server https://github.com/blairc/jgrouper-server, http://grouper.internet2.edu
42
+ http://grouper.internet2.edu
106
43
 
data/Rakefile CHANGED
@@ -1,25 +1,5 @@
1
- #!/usr/bin/env rake
2
1
  require 'bundler/gem_tasks'
3
- require 'rake/clean'
4
- require 'rake/testtask'
5
2
  require 'rdoc-readme/rake_task'
6
- require 'rdoc/task'
7
-
8
- %w{ coverage goz.log html out.txt pkg }.each { |p| CLEAN.include(p) }
9
- %w{ build install rdoc test }.each { |t| task t.to_sym => [ 'rdoc:readme' ] }
10
-
11
- task :default => :test
12
-
13
- Rake::TestTask.new do |t|
14
- t.libs << 'test'
15
- t.test_files = FileList['test/test_*.rb']
16
- t.verbose = true
17
- end
18
3
 
19
4
  RDoc::Readme::RakeTask.new 'lib/jgrouper.rb', 'README.rdoc'
20
5
 
21
- RDoc::Task.new do |rdoc|
22
- rdoc.main = 'README.rdoc'
23
- rdoc.rdoc_files.include('README.rdoc', 'lib/**/*.rb', 'doc/*.txt')
24
- end
25
-
data/TODO.md CHANGED
@@ -1,17 +1,8 @@
1
1
  JGrouper To Do
2
2
  ==============
3
3
 
4
- Future
5
- ------
6
- * Fix *JGrouper::Stem* tests
7
- * Set (select) *JGrouper::Stem* attributes
8
- * List *JGrouper::Stem* privileges
9
- * Grant *JGrouper::Stem* privileges
10
- * Revoke *JGrouper::Stem* privileges
11
- * Set (select) *JGrouper::Group* attributes
12
- * Fix *JGrouper::GroupType* tests
13
- * Fix *JGrouper::Subject* tests
14
- * Add *JGrouper::Stem#children( recurse = false )*
15
- * Add *JGrouper::Stem#groups( recurse = false )*
16
- * Add *JGrouper::Stem#stems( recurse = false )*
4
+ JGrouper v0.1.0
5
+ ---------------
6
+ * TBD
7
+ * Add *jgrouper-export* script
17
8
 
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env jruby
2
+
3
+ require 'jgrouper'
4
+ require 'jgrouper/audit_archiver'
5
+ require 'optparse'
6
+
7
+
8
+ if __FILE__ == $0
9
+ JGrouper::AuditArchiver.new do |archiver|
10
+
11
+ opts = OptionParser.new do |opts|
12
+ opts.banner = "USAGE: #{ File.basename(__FILE__) } [-h] [-s col1,colN] [-v]"
13
+
14
+ opts.on( '-s', '--skip COLUMNS', Array, 'Exclude these GROUPER_AUDIT_ENTRY comma-separated column names from archive [DEFAULT: none]' ) do |columns|
15
+ archiver.skip_columns = columns.collect { |c| c.downcase.to_sym }
16
+ end
17
+ opts.on( '-v', '--[no-]verbose', 'Enable verbose mode [DEFAULT: no]' ) do |verbose|
18
+ archiver.verbose = verbose
19
+ end
20
+ opts.on_tail('-h', '--help', "Show this message") do
21
+ puts opts
22
+ exit
23
+ end
24
+ end.parse!
25
+
26
+ # TODO DRY
27
+ if ENV['GROUPER_HOME']
28
+ JGrouper.home! ENV['GROUPER_HOME']
29
+ else
30
+ warn "ERROR: GROUPER_HOME not set"
31
+ exit 1
32
+ end
33
+
34
+ archiver.archive
35
+ end
36
+ end
37
+
38
+ # vim: syntax=ruby
39
+
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env jruby
2
+
3
+ require 'jgrouper'
4
+ require 'jgrouper/exporter'
5
+ require 'optparse'
6
+
7
+
8
+ if __FILE__ == $0
9
+ JGrouper::Exporter.new do |exporter|
10
+
11
+ opts = OptionParser.new do |opts|
12
+ opts.banner = "USAGE: #{ File.basename(__FILE__) } [-h]"
13
+
14
+ # opts.on( '-s', '--skip COLUMNS', Array, 'Exclude these GROUPER_AUDIT_ENTRY comma-separated column names from archive [DEFAULT: none]' ) do |columns|
15
+ # archiver.skip_columns = columns.collect { |c| c.downcase.to_sym }
16
+ # end
17
+ opts.on_tail('-h', '--help', "Show this message") do
18
+ puts opts
19
+ exit
20
+ end
21
+ opts.on_tail( '-v', '--[no-]verbose', 'Enable verbose mode [DEFAULT: no]' ) do |verbose|
22
+ exporter.verbose = verbose
23
+ end
24
+ end.parse!
25
+
26
+ # TODO DRY
27
+ if ENV['GROUPER_HOME']
28
+ JGrouper.home! ENV['GROUPER_HOME']
29
+ else
30
+ warn "ERROR: GROUPER_HOME not set"
31
+ exit 1
32
+ end
33
+
34
+ exporter.export ARGV.shift
35
+ end
36
+ end
37
+
38
+ # vim: syntax=ruby
39
+
data/jgrouper.gemspec CHANGED
@@ -1,27 +1,25 @@
1
- # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/jgrouper/version', __FILE__)
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'jgrouper/version'
3
5
 
4
- Gem::Specification.new do |gem|
5
- gem.authors = ['blair christensen']
6
- gem.email = ['blair.christensen@gmail.com']
7
- gem.description = %q{JRuby wrapper around the Internet2 Grouper API}
8
- gem.summary = %q{JRuby wrapper around the Internet2 Grouper API}
9
- gem.homepage = %q{https://github.com/blairc/jgrouper}
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'jgrouper'
8
+ spec.version = JGrouper::VERSION
9
+ spec.authors = ['blair christensen']
10
+ spec.email = ['blair.christensen@gmail.com']
11
+ spec.description = %q{JRuby wrapper around the Internet2 Grouper API}
12
+ spec.summary = %q{JRuby wrapper around the Internet2 Grouper API}
13
+ spec.homepage = %q{https://github.com/blairc/jgrouper/}
14
+ spec.license = 'MIT'
10
15
 
11
- gem.files = `git ls-files`.split($\)
12
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
- gem.name = 'jgrouper'
15
- gem.require_paths = ['lib']
16
- gem.version = JGrouper::VERSION
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ['lib']
17
20
 
18
- gem.add_dependency 'json'
19
-
20
- gem.add_development_dependency 'factory_girl', "~> 4.0"
21
- gem.add_development_dependency 'mocha'
22
- gem.add_development_dependency 'rake'
23
- gem.add_development_dependency 'rdoc'
24
- gem.add_development_dependency 'rdoc-readme', '~> 0.1.2'
25
- gem.add_development_dependency 'simplecov'
21
+ spec.add_development_dependency 'bundler', '~> 1.3'
22
+ spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'rdoc-readme', '~> 0.1.2'
26
24
  end
27
25