code2rubylearning 0.1.3
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.
- data/.gitignore +20 -0
- data/.rvmrc +52 -0
- data/Gemfile +45 -0
- data/Guardfile +46 -0
- data/LICENSE +22 -0
- data/README.md +43 -0
- data/Rakefile +9 -0
- data/bin/code2rubylearning +46 -0
- data/code2rubylearning.gemspec +20 -0
- data/lib/code2rubylearning/filehandling.rb +28 -0
- data/lib/code2rubylearning/filter.rb +26 -0
- data/lib/code2rubylearning/parse_cli.rb +23 -0
- data/lib/code2rubylearning/version.rb +3 -0
- data/lib/code2rubylearning.rb +29 -0
- data/spec/code2rubylearning/filehandling_spec.rb +7 -0
- data/spec/code2rubylearning/filter_spec.rb +39 -0
- data/spec/code2rubylearning/parse_cli_spec.rb +20 -0
- data/spec/code2rubylearning/version_spec.rb +13 -0
- data/spec/code2rubylearning_spec.rb +6 -0
- data/spec/spec_helper.rb +19 -0
- metadata +96 -0
data/.gitignore
ADDED
data/.rvmrc
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
|
3
|
+
# This is an RVM Project .rvmrc file, used to automatically load the ruby
|
4
|
+
# development environment upon cd'ing into the directory
|
5
|
+
|
6
|
+
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
|
7
|
+
# Only full ruby name is supported here, for short names use:
|
8
|
+
# echo "rvm use 1.9.3" > .rvmrc
|
9
|
+
environment_id="ruby-1.9.3@code2rubylearning"
|
10
|
+
|
11
|
+
# Uncomment the following lines if you want to verify rvm version per project
|
12
|
+
# rvmrc_rvm_version="1.17.2 (master)" # 1.10.1 seams as a safe start
|
13
|
+
# eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
|
14
|
+
# echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
|
15
|
+
# return 1
|
16
|
+
# }
|
17
|
+
|
18
|
+
# First we attempt to load the desired environment directly from the environment
|
19
|
+
# file. This is very fast and efficient compared to running through the entire
|
20
|
+
# CLI and selector. If you want feedback on which environment was used then
|
21
|
+
# insert the word 'use' after --create as this triggers verbose mode.
|
22
|
+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
|
23
|
+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
|
24
|
+
then
|
25
|
+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
|
26
|
+
[[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
|
27
|
+
\. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
|
28
|
+
if [[ $- == *i* ]] # check for interactive shells
|
29
|
+
then echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
|
30
|
+
else echo "Using: $GEM_HOME" # don't use colors in non-interactive shells
|
31
|
+
fi
|
32
|
+
else
|
33
|
+
# If the environment file has not yet been created, use the RVM CLI to select.
|
34
|
+
rvm --create use "$environment_id" || {
|
35
|
+
echo "Failed to create RVM environment '${environment_id}'."
|
36
|
+
return 1
|
37
|
+
}
|
38
|
+
fi
|
39
|
+
|
40
|
+
# If you use bundler, this might be useful to you:
|
41
|
+
# if [[ -s Gemfile ]] && {
|
42
|
+
# ! builtin command -v bundle >/dev/null ||
|
43
|
+
# builtin command -v bundle | GREP_OPTIONS= \grep $rvm_path/bin/bundle >/dev/null
|
44
|
+
# }
|
45
|
+
# then
|
46
|
+
# printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
|
47
|
+
# gem install bundler
|
48
|
+
# fi
|
49
|
+
# if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
|
50
|
+
# then
|
51
|
+
# bundle install | GREP_OPTIONS= \grep -vE '^Using|Your bundle is complete'
|
52
|
+
# fi
|
data/Gemfile
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
# Specify your gem's dependencies in code2rubylearning.gemspec
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
gem 'rake'
|
7
|
+
gem 'clippy', "~> 1.0.1"
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
|
11
|
+
# gem 'guard-ronn'
|
12
|
+
# gem 'yard'
|
13
|
+
# gem 'redcarpet'
|
14
|
+
|
15
|
+
require 'rbconfig'
|
16
|
+
|
17
|
+
if RbConfig::CONFIG['target_os'] =~ /darwin/i
|
18
|
+
gem 'rb-fsevent', :require => false
|
19
|
+
|
20
|
+
if `uname`.strip == 'Darwin' && `sw_vers -productVersion`.strip >= '10.8'
|
21
|
+
gem 'terminal-notifier-guard', '~> 1.5.3', :require => false
|
22
|
+
else
|
23
|
+
gem 'growl', :require => false
|
24
|
+
end rescue Errno::ENOENT
|
25
|
+
|
26
|
+
elsif RbConfig::CONFIG['target_os'] =~ /linux/i
|
27
|
+
gem 'libnotify', '~> 0.8.0', :require => false
|
28
|
+
gem 'rb-inotify', :require => false
|
29
|
+
|
30
|
+
elsif RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i
|
31
|
+
gem 'win32console', :require => false
|
32
|
+
gem 'rb-notifu', '>= 0.0.4', :require => false
|
33
|
+
gem 'wdm', :require => false
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
group :test do
|
38
|
+
gem 'minitest', "~> 4.3.3"
|
39
|
+
gem 'minitest-reporters'
|
40
|
+
gem 'minitest-matchers'
|
41
|
+
gem 'guard-minitest', '0.5.0'
|
42
|
+
gem 'guard', "~> 1.6.0"
|
43
|
+
gem 'guard-rspec', "~> 2.3.1"
|
44
|
+
end
|
45
|
+
|
data/Guardfile
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
# A sample Guardfile
|
2
|
+
# More info at https://github.com/guard/guard#readme
|
3
|
+
|
4
|
+
# guard 'rspec' do
|
5
|
+
# watch(%r{^spec/.+_spec\.rb$})
|
6
|
+
# watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
+
# watch('spec/spec_helper.rb') { "spec" }
|
8
|
+
|
9
|
+
# Rails example
|
10
|
+
# watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
+
# watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
+
# watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
+
# watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
|
14
|
+
# watch('config/routes.rb') { "spec/routing" }
|
15
|
+
# watch('app/controllers/application_controller.rb') { "spec/controllers" }
|
16
|
+
|
17
|
+
# Capybara features specs
|
18
|
+
# watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
|
19
|
+
|
20
|
+
# Turnip features and steps
|
21
|
+
# watch(%r{^spec/acceptance/(.+)\.feature$})
|
22
|
+
# watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
23
|
+
# end
|
24
|
+
|
25
|
+
|
26
|
+
guard 'minitest' do
|
27
|
+
# with Minitest::Unit
|
28
|
+
# watch(%r|^test/(.*)\/?test_(.*)\.rb|)
|
29
|
+
# watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
|
30
|
+
# watch(%r|^test/test_helper\.rb|) { "test" }
|
31
|
+
|
32
|
+
# with Minitest::Spec
|
33
|
+
watch(%r|^spec/(.*)_spec\.rb|)
|
34
|
+
watch(%r|^lib/(.*)([^/]+)\.rb|) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
35
|
+
watch(%r|^spec/spec_helper\.rb|) { "spec" }
|
36
|
+
|
37
|
+
# Rails 3.2
|
38
|
+
# watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/controllers/#{m[1]}_test.rb" }
|
39
|
+
# watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
|
40
|
+
# watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
|
41
|
+
|
42
|
+
# Rails
|
43
|
+
# watch(%r|^app/controllers/(.*)\.rb|) { |m| "test/functional/#{m[1]}_test.rb" }
|
44
|
+
# watch(%r|^app/helpers/(.*)\.rb|) { |m| "test/helpers/#{m[1]}_test.rb" }
|
45
|
+
# watch(%r|^app/models/(.*)\.rb|) { |m| "test/unit/#{m[1]}_test.rb" }
|
46
|
+
end
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 Rudi Luzar
|
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.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
# Code2rubylearning
|
2
|
+
command line tool that formats, given source code files, making them ready for pasting to the rubylearning.org forum.
|
3
|
+
|
4
|
+
# Under Development
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'code2rubylearning', :git => "https://github.com/rudicode/code2rubylearning.git", :branch => "master"
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
This should install clippy 1.0.1 as well.
|
15
|
+
|
16
|
+
To see if it works
|
17
|
+
|
18
|
+
$ bundle exec code2rubylearning
|
19
|
+
|
20
|
+
This should copy the text string "Text to copy to clip board." to your clipboard.
|
21
|
+
|
22
|
+
## Contributing
|
23
|
+
|
24
|
+
1. Fork it
|
25
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
26
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
27
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
28
|
+
5. Create new Pull Request
|
29
|
+
|
30
|
+
## Development Setup
|
31
|
+
|
32
|
+
Do `bundle install`
|
33
|
+
|
34
|
+
To run minitest specs
|
35
|
+
`bundle exec rake spec`
|
36
|
+
|
37
|
+
To run test program
|
38
|
+
`bundle exec ruby bin/code2rubylearning FILE`
|
39
|
+
|
40
|
+
If the test program runs successfuly it should have copied the contents of FILE to the clipboard.
|
41
|
+
|
42
|
+
I only have a linux system to test on so could Mac and Windows users report any problems.
|
43
|
+
Just open a new issue.
|
data/Rakefile
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'code2rubylearning'
|
5
|
+
|
6
|
+
options = {}
|
7
|
+
|
8
|
+
optparse = OptionParser.new do|opt|
|
9
|
+
opt.banner = "code2rubylearning version: #{ Code2rubylearning::VERSION }\n\nUsage: code2rubylearning [options] file1 file2 ..."
|
10
|
+
|
11
|
+
# options
|
12
|
+
options[:stdout] = false
|
13
|
+
opt.on( '-s', '--stdout', 'Output to stdout' ) do
|
14
|
+
options[:stdout] = true
|
15
|
+
end
|
16
|
+
|
17
|
+
options[:combine] = false
|
18
|
+
opt.on( '-c', '--combine', 'Combine multiple files into one ( not yet implemented )' ) do
|
19
|
+
options[:combine] = true
|
20
|
+
end
|
21
|
+
|
22
|
+
options[:filenames] = true
|
23
|
+
opt.on( '-f', '--nofilenames', 'Suppress filename line in output' ) do
|
24
|
+
options[:filenames] = false
|
25
|
+
end
|
26
|
+
|
27
|
+
opt.on( '-h', '--help', 'Display help screen' ) do
|
28
|
+
puts opt
|
29
|
+
exit 1
|
30
|
+
end
|
31
|
+
end
|
32
|
+
begin optparse.parse! ARGV
|
33
|
+
|
34
|
+
rescue OptionParser::InvalidOption => e
|
35
|
+
puts e
|
36
|
+
puts optparse
|
37
|
+
exit 1
|
38
|
+
end
|
39
|
+
|
40
|
+
if ARGV.empty?
|
41
|
+
puts optparse
|
42
|
+
exit 1
|
43
|
+
end
|
44
|
+
|
45
|
+
Code2rubylearning.start ARGV, options
|
46
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'code2rubylearning/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |gem|
|
7
|
+
gem.name = "code2rubylearning"
|
8
|
+
gem.version = Code2rubylearning::VERSION
|
9
|
+
gem.authors = ["Rudi Luzar"]
|
10
|
+
gem.email = ["rudi@rudi.me"]
|
11
|
+
gem.description = "command line tool that formats, given source code files, making them ready for pasting to the rubylearning.org forum."
|
12
|
+
gem.summary = "command line tool that formats, given source code files, making them ready for pasting to the rubylearning.org forum."
|
13
|
+
gem.homepage = "https://github.com/rudicode/code2rubylearning"
|
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
|
+
gem.add_runtime_dependency "clippy", "~> 1.0.0"
|
20
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Code2rubylearning
|
2
|
+
class FileHandling
|
3
|
+
def initialize(file)
|
4
|
+
load_data file
|
5
|
+
end
|
6
|
+
|
7
|
+
def get_data
|
8
|
+
@data
|
9
|
+
end
|
10
|
+
|
11
|
+
def get_file file
|
12
|
+
load_data file
|
13
|
+
@data
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
def load_data file
|
18
|
+
@data = ""
|
19
|
+
if file
|
20
|
+
@file = file
|
21
|
+
if File.exists?(@file)
|
22
|
+
@data = IO.read(@file)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Code2rubylearning
|
2
|
+
class Filter
|
3
|
+
def initialize options
|
4
|
+
@options = options
|
5
|
+
end
|
6
|
+
|
7
|
+
def apply input, file_name
|
8
|
+
add_header(file_name) << convert(input) << add_footer
|
9
|
+
end
|
10
|
+
|
11
|
+
def add_header file_name
|
12
|
+
header = "[code ruby]\n"
|
13
|
+
header << "#filename: #{ file_name }\n" if @options[:filenames]
|
14
|
+
header
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_footer
|
18
|
+
"[/code]\n"
|
19
|
+
end
|
20
|
+
|
21
|
+
def convert source
|
22
|
+
source.gsub('<','<')
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Code2rubylearning
|
2
|
+
module ParseCLI
|
3
|
+
|
4
|
+
extend self
|
5
|
+
|
6
|
+
attr_reader :files, :options
|
7
|
+
|
8
|
+
def parse args
|
9
|
+
@files = []
|
10
|
+
@options = []
|
11
|
+
@args = args
|
12
|
+
|
13
|
+
@args.each do |arg|
|
14
|
+
if arg.include?('-')
|
15
|
+
@options << arg
|
16
|
+
else
|
17
|
+
@files << arg
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'clippy'
|
2
|
+
require 'code2rubylearning/version'
|
3
|
+
require 'code2rubylearning/filter'
|
4
|
+
require 'code2rubylearning/filehandling'
|
5
|
+
require 'code2rubylearning/parse_cli'
|
6
|
+
|
7
|
+
module Code2rubylearning
|
8
|
+
|
9
|
+
extend self
|
10
|
+
|
11
|
+
def start args, options
|
12
|
+
ParseCLI.parse args
|
13
|
+
files = ParseCLI.files
|
14
|
+
# options = ParseCLI.options
|
15
|
+
@buffer = ""
|
16
|
+
|
17
|
+
files.each do |file|
|
18
|
+
current_file = FileHandling.new(file)
|
19
|
+
current_data = current_file.get_data
|
20
|
+
filter = Filter.new(options)
|
21
|
+
@buffer << filter.apply(current_data, file)
|
22
|
+
end
|
23
|
+
|
24
|
+
Clippy.copy @buffer unless @buffer.empty?
|
25
|
+
puts @buffer if options[:stdout]
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "Filter" do
|
4
|
+
before :each do
|
5
|
+
@options = {}
|
6
|
+
@filter = Filter.new(@options)
|
7
|
+
end
|
8
|
+
|
9
|
+
describe ".convert" do
|
10
|
+
it "should convert single < to < in a string" do
|
11
|
+
original = 'class Automobile < Vehicle'
|
12
|
+
expected = 'class Automobile < Vehicle'
|
13
|
+
@filter.convert(original).must_equal expected
|
14
|
+
end
|
15
|
+
|
16
|
+
it "should convert multiple << to << in a string" do
|
17
|
+
original = 'my_array << "some string"'
|
18
|
+
expected = 'my_array << "some string"'
|
19
|
+
@filter.convert(original).must_equal expected
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
23
|
+
|
24
|
+
describe ".apply" do
|
25
|
+
it "should add [code ruby] to original string" do
|
26
|
+
original = "class Automobile < Vehicle\n #comment\nend"
|
27
|
+
expected = "[code ruby]\n"
|
28
|
+
@filter.apply(original, "filename1.rb").must_include expected
|
29
|
+
end
|
30
|
+
|
31
|
+
it "should add [/code] to original string" do
|
32
|
+
original = "class Automobile < Vehicle\n #comment\nend"
|
33
|
+
expected = "[/code]\n"
|
34
|
+
@filter.apply(original, "filename1.rb").must_include expected
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe "ParseCLI" do
|
4
|
+
before :each do
|
5
|
+
#
|
6
|
+
end
|
7
|
+
|
8
|
+
describe ".parse" do
|
9
|
+
it "should parse command line into files and options" do
|
10
|
+
cmd_line = ['file1.rb', '-b', '--help', 'file2.rb', 'file3.txt']
|
11
|
+
|
12
|
+
expected_files = ['file1.rb', 'file2.rb', 'file3.txt']
|
13
|
+
expected_options = ['-b', '--help']
|
14
|
+
ParseCLI.parse cmd_line
|
15
|
+
ParseCLI.files.must_equal expected_files
|
16
|
+
ParseCLI.options.must_equal expected_options
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "bundler/setup"
|
3
|
+
require 'minitest/autorun'
|
4
|
+
require 'minitest/reporters'
|
5
|
+
require "minitest/matchers"
|
6
|
+
|
7
|
+
reporters = [ MiniTest::Reporters::DefaultReporter.new,
|
8
|
+
MiniTest::Reporters::SpecReporter.new,
|
9
|
+
MiniTest::Reporters::ProgressReporter.new,
|
10
|
+
MiniTest::Reporters::GuardReporter.new,
|
11
|
+
#MiniTest::Reporters::RubyMineReporter.new,
|
12
|
+
#MiniTest::Reporters::RubyMateReporter.new,
|
13
|
+
]
|
14
|
+
MiniTest::Reporters.use! [reporters[1]]
|
15
|
+
|
16
|
+
require('code2rubylearning')
|
17
|
+
require('code2rubylearning/version')
|
18
|
+
|
19
|
+
include Code2rubylearning
|
metadata
ADDED
@@ -0,0 +1,96 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: code2rubylearning
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Rudi Luzar
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-31 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: clippy
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.0.0
|
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: 1.0.0
|
30
|
+
description: command line tool that formats, given source code files, making them
|
31
|
+
ready for pasting to the rubylearning.org forum.
|
32
|
+
email:
|
33
|
+
- rudi@rudi.me
|
34
|
+
executables:
|
35
|
+
- code2rubylearning
|
36
|
+
extensions: []
|
37
|
+
extra_rdoc_files: []
|
38
|
+
files:
|
39
|
+
- .gitignore
|
40
|
+
- .rvmrc
|
41
|
+
- Gemfile
|
42
|
+
- Guardfile
|
43
|
+
- LICENSE
|
44
|
+
- README.md
|
45
|
+
- Rakefile
|
46
|
+
- bin/code2rubylearning
|
47
|
+
- code2rubylearning.gemspec
|
48
|
+
- lib/code2rubylearning.rb
|
49
|
+
- lib/code2rubylearning/filehandling.rb
|
50
|
+
- lib/code2rubylearning/filter.rb
|
51
|
+
- lib/code2rubylearning/parse_cli.rb
|
52
|
+
- lib/code2rubylearning/version.rb
|
53
|
+
- spec/code2rubylearning/filehandling_spec.rb
|
54
|
+
- spec/code2rubylearning/filter_spec.rb
|
55
|
+
- spec/code2rubylearning/parse_cli_spec.rb
|
56
|
+
- spec/code2rubylearning/version_spec.rb
|
57
|
+
- spec/code2rubylearning_spec.rb
|
58
|
+
- spec/spec_helper.rb
|
59
|
+
homepage: https://github.com/rudicode/code2rubylearning
|
60
|
+
licenses: []
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ! '>='
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
hash: -616480127
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ! '>='
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
hash: -616480127
|
83
|
+
requirements: []
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 1.8.24
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: command line tool that formats, given source code files, making them ready
|
89
|
+
for pasting to the rubylearning.org forum.
|
90
|
+
test_files:
|
91
|
+
- spec/code2rubylearning/filehandling_spec.rb
|
92
|
+
- spec/code2rubylearning/filter_spec.rb
|
93
|
+
- spec/code2rubylearning/parse_cli_spec.rb
|
94
|
+
- spec/code2rubylearning/version_spec.rb
|
95
|
+
- spec/code2rubylearning_spec.rb
|
96
|
+
- spec/spec_helper.rb
|