Pickaxe 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/README.markdown +4 -0
- data/bin/pickaxe +74 -0
- metadata +113 -0
data/README.markdown
ADDED
data/bin/pickaxe
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
|
5
|
+
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + "/../lib"))
|
6
|
+
|
7
|
+
require 'pickaxe'
|
8
|
+
|
9
|
+
# TODO:
|
10
|
+
# time limit
|
11
|
+
# syntax check only
|
12
|
+
# default -> warns + ignore, options for exception on syntax error ;-)
|
13
|
+
|
14
|
+
options = {}
|
15
|
+
OptionParser.new do |opts|
|
16
|
+
opts.banner = <<END_OF_BANNER
|
17
|
+
Usage:
|
18
|
+
pick path [, path ...]
|
19
|
+
pickaxe path [, path ...]
|
20
|
+
|
21
|
+
Uses given paths (files or directories) to generate a test from *.txt files.
|
22
|
+
END_OF_BANNER
|
23
|
+
|
24
|
+
opts.separator ""
|
25
|
+
opts.on("-e", "--ext [EXTENSION]", "Use files with given EXTENSION (default 'txt')") do |extension|
|
26
|
+
options[:extension] = extension
|
27
|
+
end
|
28
|
+
|
29
|
+
opts.on("-s", "--sorted", "Do not shuffle questions") do |v|
|
30
|
+
options[:sorted] = true
|
31
|
+
end
|
32
|
+
|
33
|
+
opts.on("--select [NUMBER]", "Select certain amount of questions") do |v|
|
34
|
+
options[:select] = Integer(v)
|
35
|
+
end
|
36
|
+
|
37
|
+
opts.on("-b", "--builtin", "Runs builtin tests") do |v|
|
38
|
+
options[:builtin] = true
|
39
|
+
end
|
40
|
+
|
41
|
+
opts.on("--list-builtin", "Lists builtin test names") do |v|
|
42
|
+
options[:list_builtin] = true
|
43
|
+
end
|
44
|
+
|
45
|
+
opts.on_tail("--version", "Show version") do
|
46
|
+
puts "pickaxe version #{Pickaxe::VERSION}"
|
47
|
+
exit
|
48
|
+
end
|
49
|
+
|
50
|
+
opts.on_tail("-h", "--help", "Show this message") do
|
51
|
+
puts opts
|
52
|
+
exit
|
53
|
+
end
|
54
|
+
end.parse!
|
55
|
+
|
56
|
+
if options[:list_builtin]
|
57
|
+
puts(Dir.glob(File.dirname(__FILE__) + "/../tests/*.#{options[:extension] || "txt"}").collect do |file|
|
58
|
+
File.basename(file)
|
59
|
+
end.join(" "))
|
60
|
+
exit
|
61
|
+
end
|
62
|
+
|
63
|
+
paths = if options[:builtin]
|
64
|
+
File.expand_path(File.dirname(__FILE__) + "/../tests")
|
65
|
+
else
|
66
|
+
ARGV
|
67
|
+
end
|
68
|
+
|
69
|
+
begin
|
70
|
+
Pickaxe::Main.new(paths, options)
|
71
|
+
rescue Pickaxe::PickaxeError => e
|
72
|
+
$stderr.puts(("! " + e.message).color(:red))
|
73
|
+
exit(e.status_code)
|
74
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: Pickaxe
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Dawid Fatyga
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-16 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
hash: 17
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 0
|
31
|
+
- 3
|
32
|
+
version: 1.0.3
|
33
|
+
requirement: *id001
|
34
|
+
name: bundler
|
35
|
+
prerelease: false
|
36
|
+
type: :runtime
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
requirement: *id002
|
48
|
+
name: activesupport
|
49
|
+
prerelease: false
|
50
|
+
type: :runtime
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
61
|
+
requirement: *id003
|
62
|
+
name: i18n
|
63
|
+
prerelease: false
|
64
|
+
type: :runtime
|
65
|
+
description: " Pickaxe provides a simple way to load, solve and rate tests (bundle of questions)\n written in simple text format.\n"
|
66
|
+
email: dawid.fatyga@gmail.com
|
67
|
+
executables:
|
68
|
+
- pickaxe
|
69
|
+
extensions: []
|
70
|
+
|
71
|
+
extra_rdoc_files:
|
72
|
+
- README.markdown
|
73
|
+
files:
|
74
|
+
- README.markdown
|
75
|
+
- bin/pickaxe
|
76
|
+
has_rdoc: true
|
77
|
+
homepage: https://github.com/dejw/pickaxe
|
78
|
+
licenses: []
|
79
|
+
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
|
83
|
+
require_paths:
|
84
|
+
- lib
|
85
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
86
|
+
none: false
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
hash: 57
|
91
|
+
segments:
|
92
|
+
- 1
|
93
|
+
- 8
|
94
|
+
- 7
|
95
|
+
version: 1.8.7
|
96
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ">="
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
hash: 3
|
102
|
+
segments:
|
103
|
+
- 0
|
104
|
+
version: "0"
|
105
|
+
requirements: []
|
106
|
+
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 1.3.7
|
109
|
+
signing_key:
|
110
|
+
specification_version: 3
|
111
|
+
summary: Pickaxe allows to run tests (bundle of questions) written in simple text format.
|
112
|
+
test_files: []
|
113
|
+
|