sfp 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -2
- data/bin/sfp +4 -3
- data/lib/sfp/planner.rb +4 -4
- data/sfp.gemspec +1 -1
- metadata +6 -5
data/README.md
CHANGED
@@ -1,8 +1,7 @@
|
|
1
1
|
SFP Parser and Planner for Ruby
|
2
2
|
===============================
|
3
3
|
- Author: Herry (herry13@gmail.com)
|
4
|
-
-
|
5
|
-
- Version: 0.2.0
|
4
|
+
- Version: 0.2.1
|
6
5
|
- License: [BSD License](https://github.com/herry13/sfp-ruby/blob/master/LICENSE)
|
7
6
|
|
8
7
|
A Ruby gem that provides a Ruby interface to parse SFP language. It also provides
|
@@ -54,6 +53,13 @@ To use as a command line to solve a planning task
|
|
54
53
|
The planning task must be written in [SFP language](https://github.com/herry13/nuri/wiki/SFP-language).
|
55
54
|
|
56
55
|
|
56
|
+
To generate a parallel (partial-order) plan
|
57
|
+
-------------------------------------------
|
58
|
+
- use option **--parallel** to generate a partial order plan
|
59
|
+
|
60
|
+
$ sfp --parallel <sfp-file>
|
61
|
+
|
62
|
+
|
57
63
|
To use as Ruby library
|
58
64
|
----------------------
|
59
65
|
- include file **main.sfp** in your codes:
|
data/bin/sfp
CHANGED
@@ -4,7 +4,7 @@ libdir = File.expand_path(File.dirname(__FILE__))
|
|
4
4
|
require "#{libdir}/../lib/sfp"
|
5
5
|
|
6
6
|
opts = Trollop::options do
|
7
|
-
version "sfp 0.2.
|
7
|
+
version "sfp 0.2.1 (c) 2013 Herry"
|
8
8
|
banner <<-EOS
|
9
9
|
Parse a SFP file, solve the planning task, and print the plan (if found) in JSON format.
|
10
10
|
|
@@ -14,6 +14,7 @@ Usage:
|
|
14
14
|
where [options] are:
|
15
15
|
EOS
|
16
16
|
|
17
|
+
opt :parallel, "generate a parallel (partial-order) plan, instead of sequential"
|
17
18
|
opt :json, "parse a SFP file and print it in JSON format"
|
18
19
|
opt :solve_execute, "parse a SFP File, solve the planning task, " +
|
19
20
|
"and execute the plan with given execution framework"
|
@@ -31,7 +32,7 @@ elsif opts[:solve_execute]
|
|
31
32
|
abort "There is no available execution framework!" if not opts[:bash]
|
32
33
|
|
33
34
|
planner = Sfp::Planner.new
|
34
|
-
plan = planner.solve({:file => ARGV[0]})
|
35
|
+
plan = planner.solve({:file => ARGV[0], :parallel => opts[:parallel]})
|
35
36
|
puts "Plan: #{plan.inspect}"
|
36
37
|
executor = Sfp::BashExecutor.new
|
37
38
|
puts "Execution:"
|
@@ -46,7 +47,7 @@ elsif opts[:execute]
|
|
46
47
|
|
47
48
|
elsif ARGV.length > 0
|
48
49
|
planner = Sfp::Planner.new
|
49
|
-
puts planner.solve({:file => ARGV[0], :pretty_json => true})
|
50
|
+
puts planner.solve({:file => ARGV[0], :pretty_json => true, :parallel => opts[:parallel]})
|
50
51
|
|
51
52
|
else
|
52
53
|
Trollop::help
|
data/lib/sfp/planner.rb
CHANGED
@@ -32,8 +32,8 @@ module Sfp
|
|
32
32
|
# @param :sfp : SFP task in Hash data structure
|
33
33
|
# @param :file : SFP task in file with specified path
|
34
34
|
# @param :sas_plan : if true then return a raw SAS plan
|
35
|
-
# @param :parallel : if true then return a parallel (partial-order) plan
|
36
|
-
#
|
35
|
+
# @param :parallel : if true then return a parallel (partial-order) plan,
|
36
|
+
# if false or nil then return a sequential plan
|
37
37
|
# @param :json : if true then return the plan in JSON
|
38
38
|
# @param :pretty_json : if true then return in pretty JSON
|
39
39
|
#
|
@@ -55,8 +55,8 @@ module Sfp
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
# @param :parallel : if true then return a parallel (partial-order) plan
|
59
|
-
#
|
58
|
+
# @param :parallel : if true then return a parallel (partial-order) plan,
|
59
|
+
# if false or nil then return a sequential plan
|
60
60
|
# @param :json : if true then return the plan in JSON
|
61
61
|
# @param :pretty_json : if true then return in pretty JSON
|
62
62
|
#
|
data/sfp.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sfp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2013-05-15 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
16
|
-
requirement: &
|
16
|
+
requirement: &7789060 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 1.7.5
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *7789060
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: antlr3
|
27
|
-
requirement: &
|
27
|
+
requirement: &7788020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: 1.8.12
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *7788020
|
36
36
|
description: A Ruby gem that provides a Ruby API to SFP language parser and SFP planner.
|
37
37
|
It also provides a planner sript to solve a planning problem written in SFP language.
|
38
38
|
email: herry13@gmail.com
|
@@ -61,6 +61,7 @@ files:
|
|
61
61
|
- lib/sfp/sfw2graph.rb
|
62
62
|
- lib/sfp/trollop.rb
|
63
63
|
- lib/sfp/visitors.rb
|
64
|
+
- modules/.gitignore
|
64
65
|
- sfp.gemspec
|
65
66
|
- src/SfpLang.g
|
66
67
|
- src/build.sh
|