jgrouper-shell 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/Gemfile +4 -0
- data/HISTORY.md +7 -0
- data/LICENSE.txt +22 -0
- data/README.rdoc +65 -0
- data/Rakefile +25 -0
- data/TODO.md +16 -0
- data/bin/jgrouper +9 -0
- data/jgrouper-shell.gemspec +26 -0
- data/lib/jgrouper-shell.rb +121 -0
- data/lib/jgrouper-shell/version.rb +6 -0
- metadata +137 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/HISTORY.md
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 blair christensen
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
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.
|
data/README.rdoc
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
= JGrouper::Shell - JGrouper interactive shell
|
2
|
+
|
3
|
+
== Usage
|
4
|
+
|
5
|
+
# Launch
|
6
|
+
% jgrouper
|
7
|
+
|
8
|
+
=== Group Types
|
9
|
+
|
10
|
+
Any JGrouper::GroupType methods, such as:
|
11
|
+
|
12
|
+
JGrouper::Shell:0> group_type.all
|
13
|
+
|
14
|
+
=== Stems
|
15
|
+
|
16
|
+
Any JGrouper::Stem methods, such as:
|
17
|
+
|
18
|
+
JGrouper::Shell:0> stem.root
|
19
|
+
|
20
|
+
=== Groups
|
21
|
+
|
22
|
+
Any JGrouper::Group methods, such as:
|
23
|
+
|
24
|
+
JGrouper::Group:0> group.find 'name'
|
25
|
+
|
26
|
+
=== Subjects
|
27
|
+
|
28
|
+
Any JGrouper::Subject methods, such as:
|
29
|
+
|
30
|
+
JGrouper::Shell:0> subject.root
|
31
|
+
|
32
|
+
== Installation
|
33
|
+
|
34
|
+
Add this line to your application's Gemfile:
|
35
|
+
|
36
|
+
gem 'jgrouper-shell'
|
37
|
+
|
38
|
+
And then execute:
|
39
|
+
|
40
|
+
$ bundle
|
41
|
+
|
42
|
+
Or install it yourself as:
|
43
|
+
|
44
|
+
$ gem install jgrouper-shell
|
45
|
+
|
46
|
+
== Contributing
|
47
|
+
|
48
|
+
1. Fork it
|
49
|
+
2. Create your feature branch (+git checkout -b my-new-feature+)
|
50
|
+
3. Commit your changes (+git commit -am 'Added some feature'+)
|
51
|
+
4. Push to the branch (+git push origin my-new-feature+)
|
52
|
+
5. Create new Pull Request
|
53
|
+
|
54
|
+
== Author
|
55
|
+
|
56
|
+
blair christensen. <mailto:blair.christensen@gmail.com>
|
57
|
+
|
58
|
+
== Home Page
|
59
|
+
|
60
|
+
https://github.com/blairc/jgrouper-shell
|
61
|
+
|
62
|
+
== See Also
|
63
|
+
|
64
|
+
JGrouper https://github.com/blairc/jgrouper, http://grouper.internet2.edu
|
65
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/testtask'
|
5
|
+
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
|
+
|
19
|
+
RDoc::Readme::RakeTask.new 'lib/jgrouper-shell.rb', 'README.rdoc'
|
20
|
+
|
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
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
JGrouper::Shell To Do
|
2
|
+
=====================
|
3
|
+
|
4
|
+
JGrouper::Shell v0.0.2
|
5
|
+
----------------------
|
6
|
+
* Add *help*
|
7
|
+
* Add *group.help*
|
8
|
+
* Add *stem.help*
|
9
|
+
* Add *subject.help*
|
10
|
+
|
11
|
+
Future
|
12
|
+
------
|
13
|
+
* Make startup less chatty
|
14
|
+
* Add *gsh* compatibility commands?
|
15
|
+
* Should it be be able to run scripts?
|
16
|
+
|
data/bin/jgrouper
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'jgrouper-shell/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = 'jgrouper-shell'
|
8
|
+
gem.version = JGrouper::Shell::VERSION
|
9
|
+
gem.authors = ['blair christensen']
|
10
|
+
gem.email = ['blair.christensen@gmail.com']
|
11
|
+
gem.description = %q{JGrouper interactive shell}
|
12
|
+
gem.summary = %q{JGrouper interactive shell}
|
13
|
+
gem.homepage = %q{https://github.com/blairc/jgrouper-shell}
|
14
|
+
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.add_dependency 'jgrouper', '~> 0.0.4'
|
21
|
+
gem.add_dependency 'pry'
|
22
|
+
|
23
|
+
gem.add_development_dependency 'rake'
|
24
|
+
gem.add_development_dependency 'rdoc'
|
25
|
+
gem.add_development_dependency 'rdoc-readme', '~> 0.1.2'
|
26
|
+
end
|
@@ -0,0 +1,121 @@
|
|
1
|
+
require 'jgrouper'
|
2
|
+
require 'pry'
|
3
|
+
|
4
|
+
module JGrouper # :nodoc:
|
5
|
+
#
|
6
|
+
# = JGrouper::Shell - JGrouper interactive shell
|
7
|
+
#
|
8
|
+
# == Usage
|
9
|
+
#
|
10
|
+
# # Launch
|
11
|
+
# % jgrouper
|
12
|
+
#
|
13
|
+
# === Group Types
|
14
|
+
#
|
15
|
+
# Any JGrouper::GroupType methods, such as:
|
16
|
+
#
|
17
|
+
# JGrouper::Shell:0> group_type.all
|
18
|
+
#
|
19
|
+
# === Stems
|
20
|
+
#
|
21
|
+
# Any JGrouper::Stem methods, such as:
|
22
|
+
#
|
23
|
+
# JGrouper::Shell:0> stem.root
|
24
|
+
#
|
25
|
+
# === Groups
|
26
|
+
#
|
27
|
+
# Any JGrouper::Group methods, such as:
|
28
|
+
#
|
29
|
+
# JGrouper::Group:0> group.find 'name'
|
30
|
+
#
|
31
|
+
# === Subjects
|
32
|
+
#
|
33
|
+
# Any JGrouper::Subject methods, such as:
|
34
|
+
#
|
35
|
+
# JGrouper::Shell:0> subject.root
|
36
|
+
#
|
37
|
+
# == Installation
|
38
|
+
#
|
39
|
+
# Add this line to your application's Gemfile:
|
40
|
+
#
|
41
|
+
# gem 'jgrouper-shell'
|
42
|
+
#
|
43
|
+
# And then execute:
|
44
|
+
#
|
45
|
+
# $ bundle
|
46
|
+
#
|
47
|
+
# Or install it yourself as:
|
48
|
+
#
|
49
|
+
# $ gem install jgrouper-shell
|
50
|
+
#
|
51
|
+
# == Contributing
|
52
|
+
#
|
53
|
+
# 1. Fork it
|
54
|
+
# 2. Create your feature branch (+git checkout -b my-new-feature+)
|
55
|
+
# 3. Commit your changes (+git commit -am 'Added some feature'+)
|
56
|
+
# 4. Push to the branch (+git push origin my-new-feature+)
|
57
|
+
# 5. Create new Pull Request
|
58
|
+
#
|
59
|
+
# == Author
|
60
|
+
#
|
61
|
+
# blair christensen. <mailto:blair.christensen@gmail.com>
|
62
|
+
#
|
63
|
+
# == Home Page
|
64
|
+
#
|
65
|
+
# https://github.com/blairc/jgrouper-shell
|
66
|
+
#
|
67
|
+
# == See Also
|
68
|
+
#
|
69
|
+
# JGrouper https://github.com/blairc/jgrouper, http://grouper.internet2.edu
|
70
|
+
#
|
71
|
+
class Shell
|
72
|
+
|
73
|
+
def initialize
|
74
|
+
yield self if block_given?
|
75
|
+
self
|
76
|
+
end
|
77
|
+
|
78
|
+
#
|
79
|
+
# Access JGrouper::GroupType commands
|
80
|
+
#
|
81
|
+
def group_type
|
82
|
+
JGrouper::GroupType
|
83
|
+
end
|
84
|
+
|
85
|
+
#
|
86
|
+
# Start JGrouper shell
|
87
|
+
#
|
88
|
+
def self.run!
|
89
|
+
JGrouper.home ENV['GROUPER_HOME'] if ENV['GROUPER_HOME']
|
90
|
+
shell = new do |shell|
|
91
|
+
Pry.start shell,
|
92
|
+
:prompt => [ proc { |obj, nest_level| "#{obj.class.name}:#{nest_level}> " },
|
93
|
+
proc { "> " }
|
94
|
+
]
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
#
|
99
|
+
# Access JGrouper::Group commands
|
100
|
+
#
|
101
|
+
def group
|
102
|
+
JGrouper::Group
|
103
|
+
end
|
104
|
+
|
105
|
+
#
|
106
|
+
# Access JGrouper::Stem commands
|
107
|
+
#
|
108
|
+
def stem
|
109
|
+
JGrouper::Stem
|
110
|
+
end
|
111
|
+
|
112
|
+
#
|
113
|
+
# Access JGrouper::Subject commands
|
114
|
+
#
|
115
|
+
def subject
|
116
|
+
JGrouper::Subject
|
117
|
+
end
|
118
|
+
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
metadata
ADDED
@@ -0,0 +1,137 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jgrouper-shell
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- blair christensen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-10-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: jgrouper
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.0.4
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.0.4
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: pry
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rake
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: rdoc
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: rdoc-readme
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 0.1.2
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ~>
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 0.1.2
|
94
|
+
description: JGrouper interactive shell
|
95
|
+
email:
|
96
|
+
- blair.christensen@gmail.com
|
97
|
+
executables:
|
98
|
+
- jgrouper
|
99
|
+
extensions: []
|
100
|
+
extra_rdoc_files: []
|
101
|
+
files:
|
102
|
+
- .gitignore
|
103
|
+
- Gemfile
|
104
|
+
- HISTORY.md
|
105
|
+
- LICENSE.txt
|
106
|
+
- README.rdoc
|
107
|
+
- Rakefile
|
108
|
+
- TODO.md
|
109
|
+
- bin/jgrouper
|
110
|
+
- jgrouper-shell.gemspec
|
111
|
+
- lib/jgrouper-shell.rb
|
112
|
+
- lib/jgrouper-shell/version.rb
|
113
|
+
homepage: https://github.com/blairc/jgrouper-shell
|
114
|
+
licenses: []
|
115
|
+
post_install_message:
|
116
|
+
rdoc_options: []
|
117
|
+
require_paths:
|
118
|
+
- lib
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
none: false
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
none: false
|
127
|
+
requirements:
|
128
|
+
- - ! '>='
|
129
|
+
- !ruby/object:Gem::Version
|
130
|
+
version: '0'
|
131
|
+
requirements: []
|
132
|
+
rubyforge_project:
|
133
|
+
rubygems_version: 1.8.23
|
134
|
+
signing_key:
|
135
|
+
specification_version: 3
|
136
|
+
summary: JGrouper interactive shell
|
137
|
+
test_files: []
|