infraruby-task 3.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b73fe680b0a78fbc4a2b15cc35490885c970bf29
4
+ data.tar.gz: 940b15611f5964c0cffc9291901df7a9dec6e859
5
+ SHA512:
6
+ metadata.gz: 1c31e559f5b21bd009284294f59d866a6e5a75f1f44b2e257766db4414944a216a14e4030d148051498f29c31c36984d764c417cc906b62866a443da10e5e27c
7
+ data.tar.gz: 94f76404981160e48816fe344f1aedc93ec739bf719e5c78257daf26816f7fc285338b8b7e4617c67c5dff255aedc7ecc0897ca683bffe71cf69665d337fde27
data/MIT-LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011-2015 InfraRuby Vision
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a
4
+ copy of this software and associated documentation files (the "Software"),
5
+ to deal in the Software without restriction, including without limitation
6
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
7
+ and/or sell copies of the Software, and to permit persons to whom the
8
+ Software is furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
19
+ DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,27 @@
1
+ InfraRuby task loader
2
+ =====================
3
+
4
+ This gem provides the InfraRuby task loader.
5
+
6
+
7
+ Example
8
+ -------
9
+
10
+ require "infraruby-task"
11
+
12
+ loader = InfraRuby.task_loader
13
+ loader.add_program("hello-main")
14
+ loader.load_tasks
15
+
16
+ task "default" => "spec"
17
+
18
+
19
+ Support
20
+ -------
21
+
22
+ InfraRuby Vision
23
+ rubygems@infraruby.com
24
+
25
+ http://infraruby.com/
26
+ https://github.com/InfraRuby
27
+ https://twitter.com/InfraRuby
@@ -0,0 +1,15 @@
1
+ Gem::Specification.new do |s|
2
+ s.platform = "ruby"
3
+ s.name = "infraruby-task"
4
+ s.version = "3.7.0"
5
+ s.licenses = ["MIT"]
6
+ s.author = "InfraRuby Vision"
7
+ s.email = "rubygems@infraruby.com"
8
+ s.homepage = "http://infraruby.com/"
9
+ s.summary = "InfraRuby task loader"
10
+ s.description = "InfraRuby task loader"
11
+ s.files = Dir["**/*"]
12
+ s.add_runtime_dependency "infraruby-base", "~> 3.7"
13
+ s.add_runtime_dependency "rake", "~> 10.4"
14
+ s.add_development_dependency "rspec", "~> 3.0"
15
+ end
@@ -0,0 +1,5 @@
1
+ require "infraruby-base"
2
+
3
+ require "rake"
4
+
5
+ InfraRuby.load_parent_library(__dir__)
data/ruby/InfraRuby.rb ADDED
@@ -0,0 +1,8 @@
1
+ module InfraRuby
2
+ class << self
3
+ def task_loader
4
+ name = InfraRuby.gemspec_name
5
+ return TaskLoader.new(name)
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,152 @@
1
+ module InfraRuby
2
+ class TaskLoader
3
+ include Rake::DSL
4
+
5
+ def initialize(library)
6
+ @library = library
7
+ @programs = []
8
+ return
9
+ end
10
+
11
+ def add_program(program)
12
+ @programs << program
13
+ return
14
+ end
15
+
16
+ def build_cutfiles
17
+ cutfiles = []
18
+ library = @library
19
+ unless library.nil?
20
+ cutfiles << File.join("pool", "#{library}.cut")
21
+ end
22
+ return cutfiles
23
+ end
24
+
25
+ def build_jarfiles
26
+ jarfiles = []
27
+ library = @library
28
+ unless library.nil?
29
+ jarfiles << File.join("pool", "#{library}.jar")
30
+ end
31
+ return jarfiles
32
+ end
33
+
34
+ def load_program_tasks(program)
35
+ namespace "program" do
36
+ namespace program do
37
+ namespace "core" do
38
+ desc "compile #{program}"
39
+ task "compile" do
40
+ cutfiles = build_cutfiles
41
+ InfraRuby.with_clean_env do
42
+ InfraRuby.system!("infraruby-core-compile", File.join("pool", program), File.join("bin", program), cutfiles.join(File::PATH_SEPARATOR))
43
+ end
44
+ end
45
+ desc "execute #{program}"
46
+ task "execute" do |task, args|
47
+ jarfiles = build_jarfiles
48
+ jarfiles << File.join("pool", "#{program}.jar")
49
+ InfraRuby.with_clean_env do
50
+ InfraRuby.system!("infraruby-core-execute", jarfiles.join(File::PATH_SEPARATOR), "main", *args.extras)
51
+ end
52
+ end
53
+ end
54
+ namespace "interpret" do
55
+ desc "interpret #{program} with jruby"
56
+ task "jruby" do |task, args|
57
+ InfraRuby.system!("bundle", "exec", "jruby", File.join("bin", program), *args.extras)
58
+ end
59
+ desc "interpret #{program} with ruby"
60
+ task "ruby" do |task, args|
61
+ InfraRuby.system!("bundle", "exec", "ruby", File.join("bin", program), *args.extras)
62
+ end
63
+ end
64
+ end
65
+ end
66
+ return
67
+ end
68
+
69
+ def load_all_program_tasks
70
+ @programs.each do |program|
71
+ load_program_tasks(program)
72
+ end
73
+ return
74
+ end
75
+
76
+ def load_spec_tasks
77
+ namespace "spec" do
78
+ namespace "core" do
79
+ desc "compile specs"
80
+ task "compile" do
81
+ cutfiles = build_cutfiles
82
+ InfraRuby.with_clean_env do
83
+ InfraRuby.system!("infraruby-core-compile", File.join("pool", "spec"), "spec", cutfiles.join(File::PATH_SEPARATOR))
84
+ end
85
+ end
86
+ desc "execute specs"
87
+ task "execute" do
88
+ jarfiles = build_jarfiles
89
+ jarfiles << File.join("pool", "spec.jar")
90
+ InfraRuby.with_clean_env do
91
+ InfraRuby.system!("infraruby-core-execute", jarfiles.join(File::PATH_SEPARATOR), "spec")
92
+ end
93
+ end
94
+ end
95
+ namespace "interpret" do
96
+ desc "interpret specs with jruby"
97
+ task "jruby" do
98
+ InfraRuby.system!("bundle", "exec", "jruby", "-S", "rspec")
99
+ end
100
+ desc "interpret specs with ruby"
101
+ task "ruby" do
102
+ InfraRuby.system!("bundle", "exec", "rspec")
103
+ end
104
+ end
105
+ end
106
+ return
107
+ end
108
+
109
+ def load_library_tasks(library)
110
+ namespace "library" do
111
+ namespace "core" do
112
+ desc "compile library"
113
+ task "compile" do |task, args|
114
+ InfraRuby.with_clean_env do
115
+ InfraRuby.system!("infraruby-core-compile", File.join("pool", library), ".", args.extras.join(File::PATH_SEPARATOR))
116
+ end
117
+ end
118
+ end
119
+ end
120
+ return
121
+ end
122
+
123
+ def build_compile_tasks
124
+ tasks = []
125
+ tasks << "library:core:compile"
126
+ @programs.each do |program|
127
+ tasks << "program:#{program}:core:compile"
128
+ end
129
+ tasks << "spec:core:compile"
130
+ return tasks
131
+ end
132
+
133
+ def load_core_tasks
134
+ namespace "core" do
135
+ desc "compile"
136
+ task "compile" => build_compile_tasks
137
+ end
138
+ return
139
+ end
140
+
141
+ def load_tasks
142
+ library = @library
143
+ unless library.nil?
144
+ load_library_tasks(library)
145
+ end
146
+ load_spec_tasks
147
+ load_all_program_tasks
148
+ load_core_tasks
149
+ return
150
+ end
151
+ end
152
+ end
metadata ADDED
@@ -0,0 +1,91 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: infraruby-task
3
+ version: !ruby/object:Gem::Version
4
+ version: 3.7.0
5
+ platform: ruby
6
+ authors:
7
+ - InfraRuby Vision
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: infraruby-base
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.7'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.7'
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.4'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.4'
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: InfraRuby task loader
56
+ email: rubygems@infraruby.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - MIT-LICENSE
62
+ - README.md
63
+ - infraruby-task.gemspec
64
+ - lib/infraruby-task.rb
65
+ - ruby/InfraRuby.rb
66
+ - ruby/InfraRuby/TaskLoader.rb
67
+ homepage: http://infraruby.com/
68
+ licenses:
69
+ - MIT
70
+ metadata: {}
71
+ post_install_message:
72
+ rdoc_options: []
73
+ require_paths:
74
+ - lib
75
+ required_ruby_version: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - ">="
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
80
+ required_rubygems_version: !ruby/object:Gem::Requirement
81
+ requirements:
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: '0'
85
+ requirements: []
86
+ rubyforge_project:
87
+ rubygems_version: 2.2.2
88
+ signing_key:
89
+ specification_version: 4
90
+ summary: InfraRuby task loader
91
+ test_files: []