rea 0.0.1

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.
Files changed (48) hide show
  1. data/CHANGELOG.md +5 -0
  2. data/Gemfile +16 -0
  3. data/Gemfile.lock +48 -0
  4. data/LICENCE.md +22 -0
  5. data/Manifest.txt +15 -0
  6. data/README.md +7 -0
  7. data/Rakefile +23 -0
  8. data/bin/rea +8 -0
  9. data/lib/rea-dblp/rea/dblp.rb +59 -0
  10. data/lib/rea-dblp/rea/dblp/entry_parser.rb +48 -0
  11. data/lib/rea-dblp/rea/dblp/grab.rb +14 -0
  12. data/lib/rea-dblp/rea/dblp/parser.rb +36 -0
  13. data/lib/rea-dblp/rea/dblp/query_result_parser.rb +38 -0
  14. data/lib/rea-dblp/rea/dblp/search.rb +18 -0
  15. data/lib/rea.rb +28 -0
  16. data/lib/rea/command.rb +62 -0
  17. data/lib/rea/command/search.rb +52 -0
  18. data/lib/rea/command/utils.rb +31 -0
  19. data/lib/rea/errors.rb +62 -0
  20. data/lib/rea/loader.rb +8 -0
  21. data/lib/rea/version.rb +14 -0
  22. data/lib/rea/work_key.rb +33 -0
  23. data/rea.gemspec +192 -0
  24. data/rea.noespec +33 -0
  25. data/spec/rea-dblp/fixtures/entries/Damas2005.xml +17 -0
  26. data/spec/rea-dblp/fixtures/entries/Damas2009.xml +16 -0
  27. data/spec/rea-dblp/fixtures/entries/Erroneous.xml +1 -0
  28. data/spec/rea-dblp/fixtures/entries/QueryEntry.xml +15 -0
  29. data/spec/rea-dblp/fixtures/entries/Unrecognized.xml +3 -0
  30. data/spec/rea-dblp/fixtures/query_results/Erroneous.xml +1 -0
  31. data/spec/rea-dblp/fixtures/query_results/QueryResult.xml +25 -0
  32. data/spec/rea-dblp/fixtures/query_results/Unrecognized.xml +3 -0
  33. data/spec/rea-dblp/test_entry_parser.rb +72 -0
  34. data/spec/rea-dblp/test_grab.rb +18 -0
  35. data/spec/rea-dblp/test_query_result_parser.rb +38 -0
  36. data/spec/rea-dblp/test_search.rb +18 -0
  37. data/spec/spec_helper.rb +12 -0
  38. data/spec/test_rea.rb +12 -0
  39. data/spec/work_key/test_parse.rb +28 -0
  40. data/spec/work_key/test_to_ruby_literal.rb +20 -0
  41. data/spec/work_key/test_to_s.rb +12 -0
  42. data/tasks/debug_mail.rake +75 -0
  43. data/tasks/debug_mail.txt +13 -0
  44. data/tasks/gem.rake +68 -0
  45. data/tasks/spec_test.rake +71 -0
  46. data/tasks/unit_test.rake +76 -0
  47. data/tasks/yard.rake +51 -0
  48. metadata +215 -0
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0"?>
2
+ <dblp>
3
+ <inproceedings key="conf/icse/DamasLRL09" mdate="2009-06-16">
4
+ <author>Christophe Damas</author>
5
+ <author>Bernard Lambeau</author>
6
+ <author>Francois Roucoux</author>
7
+ <author>Axel van Lamsweerde</author>
8
+ <title>Analyzing critical process models through behavior model synthesis.</title>
9
+ <pages>441-451</pages>
10
+ <year>2009</year>
11
+ <booktitle>ICSE</booktitle>
12
+ <ee>http://dx.doi.org/10.1109/ICSE.2009.5070543</ee>
13
+ <crossref>conf/icse/2009</crossref>
14
+ <url>db/conf/icse/icse2009.html#DamasLRL09</url>
15
+ </inproceedings>
16
+ </dblp>
@@ -0,0 +1,15 @@
1
+ <dblp>
2
+ <queryentry key="conf/icse/DamasLRL09">
3
+ <authors>
4
+ <author>Christophe Damas</author>
5
+ <author>Bernard Lambeau</author>
6
+ <author>Francois Roucoux</author>
7
+ <author>Axel van Lamsweerde</author>
8
+ </authors>
9
+ <title ee="http://dx.doi.org/10.1109/ICSE.2009.5070543">Analyzing critical process models through behavior model synthesis.</title>
10
+ <venue url="db/conf/icse/icse2009.html#DamasLRL09">ICSE 2009:441-451</venue>
11
+ <year>2009</year>
12
+ <type>inproceedings</type>
13
+ </queryentry>
14
+ </dblp>
15
+
@@ -0,0 +1,3 @@
1
+ <dblp>
2
+ <nosuchmethod/>
3
+ </dblp>
@@ -0,0 +1,25 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <result>
3
+ <query id="141893">Behavior Model Synthesis</query>
4
+ <status code="12">OK</status>
5
+ <time unit="msecs">11.72</time>
6
+ <completions total="1" computed="1" sent="1">
7
+ <c sc="6" dc="3" oc="3" id="10822972">synthesis</c>
8
+ </completions>
9
+ <suggestions computed="0" sent="0">
10
+ </suggestions>
11
+ <hits total="3" computed="3" sent="3" first="0">
12
+ <hit score="6" id="1505758">
13
+ <title><![CDATA[<dblp:authors><dblp:author>Christophe Damas</dblp:author><dblp:author>Bernard Lambeau</dblp:author><dblp:author>Francois Roucoux</dblp:author><dblp:author>Axel van Lamsweerde</dblp:author></dblp:authors><dblp:title ee="http://dx.doi.org/10.1109/ICSE.2009.5070543">Analyzing critical process models through behavior model synthesis.</dblp:title><dblp:venue url="db/conf/icse/icse2009.html#DamasLRL09">ICSE</dblp:venue><dblp:year>2009</dblp:year><dblp:type>inproceedings</dblp:type>]]></title>
14
+ <url>http://www.dblp.org/rec/bibtex/conf/icse/DamasLRL09</url>
15
+ </hit>
16
+ <hit score="6" id="1695565">
17
+ <title><![CDATA[<dblp:authors><dblp:author>Hyunok Oh</dblp:author></dblp:authors><dblp:title ee="http://doi.ieeecomputersociety.org/10.1109/ISQED.2008.138">Constant Rate Dataflow Model with Intermediate Ports for Efficient Code Synthesis with Top-Down Design and Dynamic Behavior. </dblp:title><dblp:venue url="db/conf/isqed/isqed2008.html#Oh08">ISQED 2008:190-193</dblp:venue><dblp:year>2008</dblp:year><dblp:type>inproceedings</dblp:type>]]></title>
18
+ <url>http://www.dblp.org/rec/bibtex/conf/isqed/Oh08</url>
19
+ </hit>
20
+ <hit score="6" id="1883106">
21
+ <title><![CDATA[<dblp:authors><dblp:author>Pengcheng Zhang</dblp:author><dblp:author>Yu Zhou</dblp:author><dblp:author>Bixin Li</dblp:author></dblp:authors><dblp:title ee="http://doi.ieeecomputersociety.org/10.1109/SNPD.2007.98">A service-oriented methodology supporting automatic synthesis and verification of component behavior model. </dblp:title><dblp:venue url="db/conf/snpd/snpd2007-1.html#ZhangZL07">SNPD 2007:511-516</dblp:venue><dblp:year>2007</dblp:year><dblp:type>inproceedings</dblp:type>]]></title>
22
+ <url>http://www.dblp.org/rec/bibtex/conf/snpd/ZhangZL07</url>
23
+ </hit>
24
+ </hits>
25
+ </result>
@@ -0,0 +1,3 @@
1
+ <dblp>
2
+ <nosuchmethod/>
3
+ </dblp>
@@ -0,0 +1,72 @@
1
+ require 'spec_helper'
2
+ module Rea
3
+ module DBLP
4
+ describe EntryParser do
5
+
6
+ def parse(x)
7
+ EntryParser.parse(Path.dir/"fixtures/entries"/x)
8
+ end
9
+
10
+ it 'fails gracefully on unrecognized' do
11
+ lambda{
12
+ parse("Unrecognized.xml")
13
+ }.should raise_error(ParseFormatError, /Unrecognized.xml/)
14
+ end
15
+
16
+ it 'fails gracefully on erroneous' do
17
+ lambda{
18
+ parse("Erroneous.xml")
19
+ }.should raise_error(ParseError, /Erroneous.xml/)
20
+ end
21
+
22
+ it "works on proceedings" do
23
+ got = parse "Damas2009.xml"
24
+ expected = {
25
+ :kind => "inproceedings",
26
+ :key => WorkKey("dblp://conf/icse/DamasLRL09"),
27
+ :title => "Analyzing critical process models through behavior model synthesis.",
28
+ :source => "ICSE",
29
+ :year => "2009",
30
+ :authors => ["Christophe Damas",
31
+ "Bernard Lambeau",
32
+ "Francois Roucoux",
33
+ "Axel van Lamsweerde"]
34
+ }
35
+ got.should eq([expected])
36
+ end
37
+
38
+ it "works on queryentry" do
39
+ got = parse "QueryEntry.xml"
40
+ expected = {
41
+ :kind => "inproceedings",
42
+ :key => WorkKey("dblp://conf/icse/DamasLRL09"),
43
+ :title => "Analyzing critical process models through behavior model synthesis.",
44
+ :source => "ICSE 2009:441-451",
45
+ :year => "2009",
46
+ :authors => ["Christophe Damas",
47
+ "Bernard Lambeau",
48
+ "Francois Roucoux",
49
+ "Axel van Lamsweerde"]
50
+ }
51
+ got.should eq([expected])
52
+ end
53
+
54
+ it 'works on article' do
55
+ got = parse "Damas2005.xml"
56
+ expected = {
57
+ :kind => "article",
58
+ :key => WorkKey("dblp://journals/tse/DamasLDL05"),
59
+ :title => "Generating Annotated Behavior Models from End-User Scenarios.",
60
+ :source => "IEEE Trans. Software Eng.",
61
+ :year => "2005",
62
+ :authors => ["Christophe Damas",
63
+ "Bernard Lambeau",
64
+ "Pierre Dupont",
65
+ "Axel van Lamsweerde"]
66
+ }
67
+ got.should eq([expected])
68
+ end
69
+
70
+ end
71
+ end # module DBLP
72
+ end # module Rea
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+ module Rea
3
+ describe DBLP, "grab" do
4
+
5
+ def grab(x)
6
+ DBLP.grab(x)
7
+ end
8
+
9
+ it 'works on an existing entry' do
10
+ grab("journals/tse/DamasLDL05").should be_a(Hash)
11
+ end
12
+
13
+ it 'raises a NotFoundError on unexisting entry' do
14
+ lambda{ grab("nosuchone") }.should raise_error(NotFoundError, /nosuchone/)
15
+ end
16
+
17
+ end # describe DBLP#grab
18
+ end # module Rea
@@ -0,0 +1,38 @@
1
+ require 'spec_helper'
2
+ module Rea
3
+ module DBLP
4
+ describe QueryResultParser do
5
+
6
+ def parse(x)
7
+ QueryResultParser.parse(Path.dir/"fixtures/query_results"/x)
8
+ end
9
+
10
+ it 'fails gracefully on unrecognized' do
11
+ lambda{
12
+ parse("Unrecognized.xml")
13
+ }.should raise_error(ParseFormatError, /Unrecognized.xml/)
14
+ end
15
+
16
+ it 'fails gracefully on erroneous' do
17
+ lambda{
18
+ parse("Erroneous.xml")
19
+ }.should raise_error(ParseError, /Erroneous.xml/)
20
+ end
21
+
22
+ it 'parses query results correctly' do
23
+ parse("QueryResult.xml").first.should eq({
24
+ :kind => "inproceedings",
25
+ :key => WorkKey("dblp://conf/icse/DamasLRL09"),
26
+ :title => "Analyzing critical process models through behavior model synthesis.",
27
+ :source => "ICSE",
28
+ :year => "2009",
29
+ :authors => ["Christophe Damas",
30
+ "Bernard Lambeau",
31
+ "Francois Roucoux",
32
+ "Axel van Lamsweerde"]
33
+ })
34
+ end
35
+
36
+ end
37
+ end # module DBLP
38
+ end # module Rea
@@ -0,0 +1,18 @@
1
+ require 'spec_helper'
2
+ module Rea
3
+ describe DBLP, "search" do
4
+
5
+ def search(x)
6
+ DBLP.search(x)
7
+ end
8
+
9
+ it 'works with a title' do
10
+ search(:title => "Generating Annotated Behavior Models").should be_a(Alf::Relation)
11
+ end
12
+
13
+ it 'raises an NotImplementedError if no title' do
14
+ lambda{ search(:author => "Lambeau") }.should raise_error(NotImplementedError, /Lambeau/)
15
+ end
16
+
17
+ end # describe DBLP#grab
18
+ end # module Rea
@@ -0,0 +1,12 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ require 'rea'
3
+
4
+ module Helpers
5
+ def WorkKey(str)
6
+ Rea::WorkKey(str)
7
+ end
8
+ end
9
+
10
+ RSpec.configure do |c|
11
+ c.include Helpers
12
+ end
@@ -0,0 +1,12 @@
1
+ require File.expand_path('../spec_helper', __FILE__)
2
+ describe Rea do
3
+
4
+ it "should have a version number" do
5
+ Rea.const_defined?(:VERSION).should be_true
6
+ end
7
+
8
+ it 'should have providers' do
9
+ Rea::providers.should eq([Rea::DBLP])
10
+ end
11
+
12
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+ module Rea
3
+ describe WorkKey, ".parse" do
4
+
5
+ it 'works on a typical dblp key' do
6
+ wk = WorkKey.parse("dblp://conf/icse/DamasLRL09")
7
+ wk.should be_a(WorkKey)
8
+ wk.provider.should eq("dblp")
9
+ wk.identifier.should eq("conf/icse/DamasLRL09")
10
+ end
11
+
12
+ it 'is aliased as Rea::WorkKey()' do
13
+ Rea::WorkKey("dblp://conf/icse/DamasLRL09").should be_a(WorkKey)
14
+ end
15
+
16
+ it 'is idempotent' do
17
+ wk = Rea::WorkKey("dblp://conf/icse/DamasLRL09")
18
+ Rea::WorkKey(wk).should eq(wk)
19
+ end
20
+
21
+ it 'raises an ArgumentError on an invalid key' do
22
+ proc{
23
+ WorkKey.parse("invalidkey")
24
+ }.should raise_error(ArgumentError, "Invalid work key invalidkey")
25
+ end
26
+
27
+ end
28
+ end # module Rea
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+ module Rea
3
+ describe WorkKey, "to_ruby_literal" do
4
+
5
+ let(:wk){ Rea::WorkKey("dblp://conf/icse/DamasLRL09") }
6
+
7
+ it 'returns an evaluable expression' do
8
+ eval(wk.to_ruby_literal).should be_a(WorkKey)
9
+ end
10
+
11
+ it 'should be equal to the original' do
12
+ eval(wk.to_ruby_literal).should eq(wk)
13
+ end
14
+
15
+ it 'should be understood by Alf' do
16
+ Alf::Tools.to_ruby_literal(wk).should eq(wk.to_ruby_literal)
17
+ end
18
+
19
+ end
20
+ end # module Rea
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+ module Rea
3
+ describe WorkKey, "to_s" do
4
+
5
+ let(:wk){ Rea::WorkKey("dblp://conf/icse/DamasLRL09") }
6
+
7
+ it 'works on a typical dblp key' do
8
+ wk.to_s.should eq("dblp://conf/icse/DamasLRL09")
9
+ end
10
+
11
+ end
12
+ end # module Rea
@@ -0,0 +1,75 @@
1
+ # Installs a rake task for debuging the announcement mail.
2
+ #
3
+ # This file installs the 'rake debug_mail' that flushes an announcement mail
4
+ # for your library on the standard output. It is automatically generated
5
+ # by Noe from your .noespec file, and should therefore be configured there,
6
+ # under the variables/rake_tasks/debug_mail entry, as illustrated below:
7
+ #
8
+ # variables:
9
+ # rake_tasks:
10
+ # debug_mail:
11
+ # rx_changelog_sections: /^#/
12
+ # nb_changelog_sections: 1
13
+ # ...
14
+ #
15
+ # If you have specific needs requiring manual intervention on this file,
16
+ # don't forget to set safe-override to false in your noe specification:
17
+ #
18
+ # template-info:
19
+ # manifest:
20
+ # tasks/debug_mail.rake:
21
+ # safe-override: false
22
+ #
23
+ # The mail template used can be found in debug_mail.txt. That file may be
24
+ # changed to tune the mail you want to send. If you do so, don't forget to
25
+ # add a manifest entry in your .noespec file to avoid overriding you
26
+ # changes. The mail template uses wlang, with parentheses for block
27
+ # delimiters.
28
+ #
29
+ # template-info:
30
+ # manifest:
31
+ # tasks/debug_mail.txt:
32
+ # safe-override: false
33
+ #
34
+ desc "Debug the release announcement mail"
35
+ task :debug_mail do
36
+ begin
37
+ require 'wlang'
38
+ rescue LoadError
39
+ abort "wlang is not available. Try 'gem install wlang'"
40
+ end
41
+ require 'yaml'
42
+
43
+ # Check that a .noespec file exists
44
+ noespec_file = File.expand_path('../../rea.noespec', __FILE__)
45
+ unless File.exists?(noespec_file)
46
+ raise "Unable to find .noespec project file, sorry."
47
+ end
48
+
49
+ # Load it as well as variables and options
50
+ noespec = YAML::load(File.read(noespec_file))
51
+ vars = noespec['variables'] || {}
52
+
53
+ # Changes are taken from CHANGELOG
54
+ logs = Dir[File.expand_path("../../CHANGELOG.*", __FILE__)]
55
+ unless logs.size == 1
56
+ abort "Unable to find a changelog file"
57
+ end
58
+
59
+ # Load interesting changesets
60
+ changes, end_found = [], 0
61
+ File.readlines(logs.first).select{|line|
62
+ if line =~ /^# /
63
+ break if end_found >= 1
64
+ end_found += 1
65
+ end
66
+ changes << line
67
+ }
68
+ vars['changes'] = changes.join
69
+
70
+ # WLang template
71
+ template = File.expand_path('../debug_mail.txt', __FILE__)
72
+
73
+ # Let's go!
74
+ $stdout << WLang::file_instantiate(template, vars, "wlang/active-text")
75
+ end
@@ -0,0 +1,13 @@
1
+ Subject: [ANN] !{lower} !{version} Released
2
+
3
+ !{lower} version !{version} has been released!
4
+
5
+ !{summary}
6
+
7
+ *{links as l}{* <!{l}>}{!{"\n"}}
8
+
9
+ !{description}
10
+
11
+ Changes:
12
+
13
+ !{changes}
@@ -0,0 +1,68 @@
1
+ # Installs rake tasks for gemming and packaging
2
+ #
3
+ # This file installs the 'rake package', 'rake gem' tasks and associates
4
+ # (clobber_package, repackage, ...). It is automatically generated by Noe
5
+ # from your .noespec file, and should therefore be configured there, under
6
+ # the variables/rake_tasks/gem entry, as illustrated below:
7
+ #
8
+ # variables:
9
+ # rake_tasks:
10
+ # gem:
11
+ # package_dir: pkg
12
+ # need_tar: false
13
+ # need_tar_gz: false
14
+ # need_tar_bz2: false
15
+ # need_zip: false
16
+ # ...
17
+ #
18
+ # If you have specific needs requiring manual intervention on this file,
19
+ # don't forget to set safe-override to false in your noe specification:
20
+ #
21
+ # template-info:
22
+ # manifest:
23
+ # tasks/gem.rake:
24
+ # safe-override: false
25
+ #
26
+ begin
27
+ require 'rubygems/package_task'
28
+ Gem::PackageTask.new($gemspec) do |t|
29
+
30
+ # Name of the package
31
+ t.name = $gemspec.name
32
+
33
+ # Version of the package
34
+ t.version = $gemspec.version
35
+
36
+ # Directory used to store the package files
37
+ t.package_dir = "pkg"
38
+
39
+ # True if a gzipped tar file (tgz) should be produced
40
+ t.need_tar = false
41
+
42
+ # True if a gzipped tar file (tar.gz) should be produced
43
+ t.need_tar_gz = false
44
+
45
+ # True if a bzip2'd tar file (tar.bz2) should be produced
46
+ t.need_tar_bz2 = false
47
+
48
+ # True if a zip file should be produced (default is false)
49
+ t.need_zip = false
50
+
51
+ # List of files to be included in the package.
52
+ t.package_files = $gemspec.files
53
+
54
+ # Tar command for gzipped or bzip2ed archives.
55
+ t.tar_command = "tar"
56
+
57
+ # Zip command for zipped archives.
58
+ t.zip_command = "zip"
59
+
60
+ end
61
+ rescue LoadError
62
+ task :gem do
63
+ abort 'rubygems/package_task is not available. You should verify your rubygems installation'
64
+ end
65
+ task :package do
66
+ abort 'rubygems/package_task is not available. You should verify your rubygems installation'
67
+ end
68
+ end