classroom-cli 0.1.0.pre.a

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 30da0e3aa70c377b5b5b2ded5c07a3717d13e8a4
4
+ data.tar.gz: 9043f999396339080ffbc2fbce145b901a84a407
5
+ SHA512:
6
+ metadata.gz: 31706cd725ce057971d9bcfbb39f0fe0a6ab444ebca7a4c14c4f3cb643782bfd78edbd61d0a2f5637d5e51daee5a4cc56e72c8966c23f1c76b994eea936e0de7
7
+ data.tar.gz: a72d42317de6bb1cb620fa16684faf9ef90630b78c4af8812e9271a4fdb66beb0dc32a2af6918704944818b7be541c5ec9b2f3e086ca6da36980abfc53414f05
@@ -0,0 +1,13 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ *.gem
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3.3
5
+ before_install: gem install bundler -v 1.16.1
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in classroom-cli.gemspec
6
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2018 Sille Van Landschoot
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,53 @@
1
+ # Classroom::Cli
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/classroom/cli`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'classroom-cli'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install classroom-cli
22
+
23
+ ## Usage
24
+
25
+ ### Cloning
26
+
27
+ The clone command will clone a set of repositories at once. The set of repositories is defined in a `projects.yml` file.
28
+
29
+ ```
30
+ $ classroom clone
31
+ ```
32
+
33
+ add a `projects.yml` file to your project directory containing the following example content:
34
+
35
+ ```yml
36
+ projects:
37
+ - https://github.com/courseabc/xyz
38
+ - https://github.com/courseabc/opq
39
+ ```
40
+
41
+ ## Development
42
+
43
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
44
+
45
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
46
+
47
+ ## Contributing
48
+
49
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/classroom-cli.
50
+
51
+ ## License
52
+
53
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "classroom"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,28 @@
1
+
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "classroom/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "classroom-cli"
8
+ spec.version = Classroom::VERSION
9
+ spec.authors = ["Sille Van Landschoot"]
10
+ spec.email = ["info@sillevl.be"]
11
+
12
+ spec.summary = %q{Toolbox for Github classroom}
13
+ spec.description = %q{Toolbox for Github classroom.}
14
+ spec.homepage = "https://github.com/sillevl/classroom-cli"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "exe"
21
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
+ # spec.executables = ["classroom"]
23
+ spec.require_paths = ["lib"]
24
+
25
+ spec.add_development_dependency "bundler", "~> 1.16"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rspec", "~> 3.0"
28
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "classroom/cli"
4
+
5
+ Classroom::Cli.new
@@ -0,0 +1,45 @@
1
+ require "classroom/version"
2
+ require "classroom/commands/foo"
3
+ require "classroom/commands/bar"
4
+ require "classroom/commands/version"
5
+ require "classroom/commands/clone"
6
+
7
+ module Classroom
8
+ class Cli
9
+ def initialize
10
+ require 'optparse'
11
+
12
+ options = {}
13
+ cli = OptionParser.new do |opts|
14
+ opts.banner =
15
+ " ___ _ \n"\
16
+ " / __\\| | __ _ ___ ___ _ __ ___ ___ _ __ ___ \n"\
17
+ " / / | | / _` |/ __|/ __|| '__| / _ \\ / _ \\ | '_ ` _ \\ \n"\
18
+ " / /___ | || (_| |\\__ \\\\__ \\| | | (_) || (_) || | | | | |\n"\
19
+ " \\____/ |_| \\__,_||___/|___/|_| \\___/ \\___/ |_| |_| |_|\n"\
20
+ "\n"\
21
+ "Usage: classroom [options]"
22
+
23
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
24
+ options[:verbose] = v
25
+ end
26
+ end
27
+
28
+ subcommands = {
29
+ 'version' => Classroom::Commands::Version,
30
+ 'clone' => Classroom::Commands::Clone,
31
+ 'foo' => Classroom::Commands::Foo,
32
+ 'bar' => Classroom::Commands::Bar
33
+ }
34
+
35
+ cli.order!
36
+ command = subcommands[ARGV.shift]
37
+ if command
38
+ command.optsparser.order!
39
+ command.new(options)
40
+ else
41
+ puts cli.help
42
+ end
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,19 @@
1
+ module Classroom
2
+ module Commands
3
+ class Bar
4
+ def initialize options
5
+ puts "Hello from BARAARARARARARRA"
6
+ end
7
+
8
+ def self.optsparser
9
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: classroom foo [options]"
11
+
12
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
13
+ options[:verbose] = v
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,45 @@
1
+ require 'yaml'
2
+
3
+ module Classroom
4
+ module Commands
5
+ class Clone
6
+ def initialize options
7
+
8
+ # TODO: make file an option, and give error if file does not exist
9
+ projects = YAML.load_file('projects.yml')['projects']
10
+ puts projects.inspect if options[:verbose]
11
+
12
+ puts "Clonin projects..."
13
+ projects.each do |url|
14
+ # student_name = url[/github.com\/(.*)\//, 1]
15
+ # # puts student_name
16
+
17
+ # url_path = url[/github.com\/(.*)/, 1] + ".git"
18
+ # ssh_url = "git@git.github.com:" + url_path
19
+
20
+ clone_project url
21
+ end
22
+ puts "done!"
23
+ end
24
+
25
+ def clone_project url, project_name = nil
26
+ # TODO: enable to choose projectname
27
+ system("git clone #{url}")
28
+ end
29
+
30
+ def self.optsparser
31
+ OptionParser.new do |opts|
32
+ opts.banner = "Usage: classroom foo [options]"
33
+
34
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
35
+ options[:verbose] = v
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
42
+
43
+
44
+
45
+
@@ -0,0 +1,19 @@
1
+ module Classroom
2
+ module Commands
3
+ class Foo
4
+ def initialize options
5
+ puts "Hello from FOOOOHOOOO"
6
+ end
7
+
8
+ def self.optsparser
9
+ OptionParser.new do |opts|
10
+ opts.banner = "Usage: classroom foo [options]"
11
+
12
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
13
+ options[:verbose] = v
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,21 @@
1
+ require "classroom/version"
2
+
3
+ module Classroom
4
+ module Commands
5
+ class Version
6
+ def initialize options
7
+ puts Classroom::VERSION
8
+ end
9
+
10
+ def self.optsparser
11
+ OptionParser.new do |opts|
12
+ opts.banner = "Usage: classroom foo [options]"
13
+
14
+ opts.on("-v", "--[no-]verbose", "Run verbosely") do |v|
15
+ options[:verbose] = v
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,3 @@
1
+ module Classroom
2
+ VERSION = "0.1.0-a"
3
+ end
metadata ADDED
@@ -0,0 +1,104 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: classroom-cli
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0.pre.a
5
+ platform: ruby
6
+ authors:
7
+ - Sille Van Landschoot
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2018-06-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: Toolbox for Github classroom.
56
+ email:
57
+ - info@sillevl.be
58
+ executables:
59
+ - classroom
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".travis.yml"
66
+ - Gemfile
67
+ - LICENSE.txt
68
+ - README.md
69
+ - Rakefile
70
+ - bin/console
71
+ - bin/setup
72
+ - classroom-cli.gemspec
73
+ - exe/classroom
74
+ - lib/classroom/cli.rb
75
+ - lib/classroom/commands/bar.rb
76
+ - lib/classroom/commands/clone.rb
77
+ - lib/classroom/commands/foo.rb
78
+ - lib/classroom/commands/version.rb
79
+ - lib/classroom/version.rb
80
+ homepage: https://github.com/sillevl/classroom-cli
81
+ licenses:
82
+ - MIT
83
+ metadata: {}
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">"
96
+ - !ruby/object:Gem::Version
97
+ version: 1.3.1
98
+ requirements: []
99
+ rubyforge_project:
100
+ rubygems_version: 2.5.2
101
+ signing_key:
102
+ specification_version: 4
103
+ summary: Toolbox for Github classroom
104
+ test_files: []