jarhead 0.0.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/Gemfile +4 -0
- data/LICENSE +8 -0
- data/Rakefile +14 -0
- data/bin/jarhead +55 -0
- data/jarhead.gemspec +16 -0
- metadata +90 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
/*
|
2
|
+
* ----------------------------------------------------------------------------
|
3
|
+
* "THE BEER-WARE LICENSE" (Revision 42):
|
4
|
+
* Nathan Lilienthal wrote this file. As long as you retain this notice you
|
5
|
+
* can do whatever you want with this stuff. If we meet some day, and you think
|
6
|
+
* this stuff is worth it, you can buy me a beer in return.
|
7
|
+
* ----------------------------------------------------------------------------
|
8
|
+
*/
|
data/Rakefile
ADDED
data/bin/jarhead
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
|
5
|
+
class Jarhead < Thor
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
desc "new [PROJECT_NAME]", "create a new Java project"
|
9
|
+
def new( name )
|
10
|
+
if File.directory? name
|
11
|
+
say "Folder #{name} already exists."
|
12
|
+
exit
|
13
|
+
end
|
14
|
+
Dir.mkdir name
|
15
|
+
Dir.mkdir File.join(name, 'src')
|
16
|
+
Dir.mkdir File.join(name, 'test')
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "test", "recursively run all the test classes in ./test"
|
20
|
+
def test
|
21
|
+
ensure_bin
|
22
|
+
compile = system "javac -d bin src/*.java test/*.java"
|
23
|
+
if compile
|
24
|
+
Dir.foreach('test') do |f|
|
25
|
+
next if f == '.' or f == '..'
|
26
|
+
say ".............................."
|
27
|
+
say "Testing #{File.basename(f, '.*')}"
|
28
|
+
say ".............................."
|
29
|
+
system "java -cp bin #{File.basename(f, '.*')}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
desc "exec [CLASS]", "compile src and run the given class"
|
35
|
+
def exec( klass )
|
36
|
+
ensure_bin
|
37
|
+
say ".............................."
|
38
|
+
say "Running #{klass}"
|
39
|
+
say ".............................."
|
40
|
+
compile = system "javac -d bin src/*.java"
|
41
|
+
system "java -cp bin #{klass}" if compile
|
42
|
+
end
|
43
|
+
|
44
|
+
|
45
|
+
no_tasks do
|
46
|
+
|
47
|
+
def ensure_bin
|
48
|
+
Dir.mkdir "bin" unless File.directory? 'bin'
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
Jarhead.start
|
data/jarhead.gemspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
Gem::Specification.new do |gem|
|
3
|
+
gem.authors = ["Nathan Lilienthal"]
|
4
|
+
gem.email = ["nathanlil13@me.com"]
|
5
|
+
gem.description = %q{A better way to interact with Java.}
|
6
|
+
gem.summary = %q{An assistant to ease the pains of working with Java.}
|
7
|
+
gem.homepage = "http://github.com/Epicgrim/jarhead"
|
8
|
+
|
9
|
+
gem.files = `git ls-files`.split($\)
|
10
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
11
|
+
gem.name = "jarhead"
|
12
|
+
gem.version = "0.0.3"
|
13
|
+
|
14
|
+
gem.add_runtime_dependency "thor"
|
15
|
+
gem.add_development_dependency "rake"
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: jarhead
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Nathan Lilienthal
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-15 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thor
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '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: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
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
|
+
description: A better way to interact with Java.
|
47
|
+
email:
|
48
|
+
- nathanlil13@me.com
|
49
|
+
executables:
|
50
|
+
- jarhead
|
51
|
+
extensions: []
|
52
|
+
extra_rdoc_files: []
|
53
|
+
files:
|
54
|
+
- .gitignore
|
55
|
+
- Gemfile
|
56
|
+
- LICENSE
|
57
|
+
- Rakefile
|
58
|
+
- bin/jarhead
|
59
|
+
- jarhead.gemspec
|
60
|
+
homepage: http://github.com/Epicgrim/jarhead
|
61
|
+
licenses: []
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ! '>='
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: '0'
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
hash: -3370678246121882758
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ! '>='
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
hash: -3370678246121882758
|
84
|
+
requirements: []
|
85
|
+
rubyforge_project:
|
86
|
+
rubygems_version: 1.8.24
|
87
|
+
signing_key:
|
88
|
+
specification_version: 3
|
89
|
+
summary: An assistant to ease the pains of working with Java.
|
90
|
+
test_files: []
|