waw 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/{test/spec/fixtures/empty/waw.deploy → .gemtest} +0 -0
  2. data/CHANGELOG.md +85 -0
  3. data/Gemfile +2 -0
  4. data/Gemfile.lock +37 -0
  5. data/{LICENCE.rdoc → LICENCE.md} +2 -2
  6. data/Manifest.txt +19 -0
  7. data/{README.rdoc → README.md} +11 -9
  8. data/Rakefile +23 -0
  9. data/lib/waw.rb +3 -10
  10. data/lib/waw/controllers/action_controller.rb +7 -2
  11. data/lib/waw/controllers/static/matcher.rb +77 -8
  12. data/lib/waw/controllers/static/waw_access.rb +2 -2
  13. data/lib/waw/loader.rb +3 -0
  14. data/lib/waw/version.rb +14 -0
  15. data/{test/spec → spec}/assumptions_spec.rb +1 -0
  16. data/{test/spec → spec}/controllers/action_controller_spec.rb +1 -1
  17. data/{test/spec → spec}/controllers/static/waw_access_spec.rb +1 -2
  18. data/{test/spec → spec}/environment_utils_spec.rb +1 -1
  19. data/{test/spec → spec}/ext/core/hash_spec.rb +1 -0
  20. data/{test/spec → spec}/fixtures.rb +0 -0
  21. data/{test/spec → spec}/fixtures/action/config/default.cfg +0 -0
  22. data/{test/spec → spec}/fixtures/action/lib/action_controller_test.rb +1 -1
  23. data/{test/spec → spec}/fixtures/action/waw.deploy +0 -0
  24. data/{test/spec → spec}/fixtures/action/waw.routing +0 -0
  25. data/{test/spec/fixtures/empty/waw.routing → spec/fixtures/empty/waw.deploy} +0 -0
  26. data/spec/fixtures/empty/waw.routing +0 -0
  27. data/{test/spec → spec}/fullstate/on_class_spec.rb +1 -1
  28. data/{test/spec → spec}/fullstate/on_instance_spec.rb +1 -1
  29. data/{test/spec → spec}/fullstate/session_spec.rb +1 -1
  30. data/{test/spec → spec}/fullstate/variable_spec.rb +1 -1
  31. data/{test/spec → spec}/resource_collection_spec.rb +1 -1
  32. data/spec/spec_helper.rb +5 -0
  33. data/{test/spec → spec}/tools/mail/mail_agent_spec.rb +1 -1
  34. data/{test/spec → spec}/tools/mail/mail_spec.rb +1 -1
  35. data/{test/spec → spec}/tools/mail/mailbox_spec.rb +1 -1
  36. data/{test/spec → spec}/tools/mail/template_spec.rb +1 -1
  37. data/{test/spec → spec}/validation/array_validation_spec.rb +1 -1
  38. data/{test/spec → spec}/validation/array_validator_spec.rb +1 -1
  39. data/{test/spec → spec}/validation/date_validation_spec.rb +1 -1
  40. data/{test/spec → spec}/validation/datetime_validation_spec.rb +1 -0
  41. data/{test/spec → spec}/validation/default_validation_spec.rb +1 -1
  42. data/{test/spec → spec}/validation/disjuctive_validation_spec.rb +1 -1
  43. data/{test/spec → spec}/validation/errors_spec.rb +1 -1
  44. data/{test/spec → spec}/validation/file_validator_spec.rb +1 -1
  45. data/{test/spec → spec}/validation/mail_validation_spec.rb +1 -1
  46. data/{test/spec → spec}/validation/missing_validation_spec.rb +1 -1
  47. data/{test/spec → spec}/validation/same_validation_spec.rb +1 -1
  48. data/{test/spec → spec}/validation/signature_intuition_spec.rb +1 -1
  49. data/{test/spec → spec}/validation/signature_spec.rb +1 -2
  50. data/{test/spec → spec}/validation/validation_spec.rb +1 -2
  51. data/spec/waw_spec.rb +8 -0
  52. data/{test/spec → spec}/wspec/html_analysis/tag_spec.rb +1 -1
  53. data/{test/spec → spec}/wspec/html_analysis_spec.rb +1 -1
  54. data/tasks/debug_mail.rake +78 -0
  55. data/tasks/debug_mail.txt +13 -0
  56. data/tasks/gem.rake +68 -0
  57. data/tasks/oldies.rake +22 -0
  58. data/tasks/spec_test.rake +79 -0
  59. data/tasks/unit_test.rake +77 -0
  60. data/tasks/yard.rake +51 -0
  61. data/test/bricks/action_controller/config/test.cfg +3 -0
  62. data/test/bricks/action_controller/logs/webapp.log +489 -0
  63. data/test/bricks/action_controller/logs/webapp.log.20110122 +84 -0
  64. data/test/bricks/action_controller/test/action_controller.wspec +6 -0
  65. data/test/bricks/action_controller/test/test_all.rb +20 -0
  66. data/test/bricks/action_controller/waw.deploy +1 -0
  67. data/test/bricks/action_controller/waw.routing +15 -0
  68. data/test/bricks/static_controller/logs/webapp.log +193 -50
  69. data/test/bricks/static_controller/logs/webapp.log.20110122 +84 -0
  70. data/test/bricks/static_controller/test/static_controller.wspec +17 -5
  71. data/waw.gemspec +191 -0
  72. data/waw.noespec +59 -0
  73. metadata +332 -90
  74. data/test/spec/test_all.rb +0 -7
File without changes
@@ -3,7 +3,7 @@ module Waw
3
3
  class ActionControllerTest < ::Waw::ActionController
4
4
 
5
5
  signature {}
6
- def say_hello
6
+ def say_hello(params)
7
7
  :hello
8
8
  end
9
9
 
File without changes
@@ -1,4 +1,4 @@
1
- require "waw"
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe ::Waw::FullState::OnClass do
3
3
  include ::Waw::Fixtures
4
4
  before(:each) { load_empty_app }
@@ -1,4 +1,4 @@
1
- require "waw"
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe ::Waw::FullState::OnInstance do
3
3
  include ::Waw::Fixtures
4
4
  before(:each) { load_empty_app }
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe ::Waw::Session do
3
3
  include ::Waw::Fixtures
4
4
  before(:each) { load_empty_app }
@@ -1,4 +1,4 @@
1
- require "waw"
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe Waw::FullState::Variable do
3
3
  include ::Waw::Fixtures
4
4
  before(:each) { load_empty_app }
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../spec_helper', __FILE__)
2
2
  describe ::Waw::ResourceCollection do
3
3
 
4
4
  it "should support creating resources simply" do
@@ -0,0 +1,5 @@
1
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
+ $LOAD_PATH.unshift File.expand_path('..', __FILE__)
3
+ require 'waw'
4
+ require 'fixtures'
5
+
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
2
  require 'waw/tools/mail'
3
3
  describe ::Waw::Tools::MailAgent do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
2
  require 'waw/tools/mail'
3
3
  describe ::Waw::Tools::MailAgent::Mail do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
2
  require 'waw/tools/mail'
3
3
  describe Waw::Tools::MailAgent::Mailbox do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
2
  require 'waw/tools/mail'
3
3
 
4
4
  describe ::Waw::Tools::MailAgent::Template do
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe ::Waw::Validation::ArrayValidations do
3
3
 
4
4
  it "should be correctly installed" do
@@ -1,4 +1,4 @@
1
- require "waw"
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe ::Waw::Validation::ArrayValidations::ArrayValidator do
3
3
 
4
4
  def arrayval(subvalidator)
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe "date proposed validation" do
3
3
 
4
4
  # Creates a signature
@@ -1,3 +1,4 @@
1
+ require File.expand_path('../../spec_helper', __FILE__)
1
2
  describe "datetime proposed validation" do
2
3
 
3
4
  describe "with default options" do
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe ::Waw::Validation::DefaultValidator do
3
3
 
4
4
  def default(*args, &block)
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe 'Disjunctive validators' do
3
3
 
4
4
  it "should be ok to put Integer|missing" do
@@ -1,4 +1,4 @@
1
- require "waw"
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe Waw::Validation::Error do
3
3
 
4
4
  it "should be raisable easily" do
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  require 'fileutils'
3
3
  describe ::Waw::Validation::FileValidator do
4
4
 
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe "mail proposed validation" do
3
3
 
4
4
  # Creates a signature
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe "missing validation" do
3
3
 
4
4
  # Creates a signature
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe "same proposed validation" do
3
3
 
4
4
  # Creates a signature
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  describe ::Waw::Validation::Signature do
3
3
 
4
4
  # Creates a signature
@@ -1,5 +1,4 @@
1
- require 'waw'
2
-
1
+ require File.expand_path('../../spec_helper', __FILE__)
3
2
  describe ::Waw::Validation::Signature do
4
3
 
5
4
  # Creates a signature
@@ -1,5 +1,4 @@
1
- require 'waw'
2
-
1
+ require File.expand_path('../../spec_helper', __FILE__)
3
2
  module Waw::Validation
4
3
  validator :my_validator, validator{|s| s=="I'm my_validator"}
5
4
  end
@@ -0,0 +1,8 @@
1
+ require File.expand_path('../spec_helper', __FILE__)
2
+ describe Waw do
3
+
4
+ it "should have a version number" do
5
+ Waw.const_defined?(:VERSION).should be_true
6
+ end
7
+
8
+ end
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../../spec_helper', __FILE__)
2
2
  require 'waw/wspec'
3
3
 
4
4
  describe Waw::WSpec::HTMLAnalysis::Tag do
@@ -1,4 +1,4 @@
1
- require 'waw'
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
2
  require 'waw/wspec'
3
3
 
4
4
  class ServicesController < ::Waw::ActionController
@@ -0,0 +1,78 @@
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
+ begin
35
+ require 'wlang'
36
+ require 'yaml'
37
+
38
+ desc "Debug the release announcement mail"
39
+ task :debug_mail do
40
+ # Check that a .noespec file exists
41
+ noespec_file = File.expand_path('../../waw.noespec', __FILE__)
42
+ unless File.exists?(noespec_file)
43
+ raise "Unable to find .noespec project file, sorry."
44
+ end
45
+
46
+ # Load it as well as variables and options
47
+ noespec = YAML::load(File.read(noespec_file))
48
+ vars = noespec['variables'] || {}
49
+
50
+ # Changes are taken from CHANGELOG
51
+ logs = Dir[File.expand_path("../../CHANGELOG.*", __FILE__)]
52
+ unless logs.size == 1
53
+ abort "Unable to find a changelog file"
54
+ end
55
+
56
+ # Load interesting changesets
57
+ changes, end_found = [], 0
58
+ File.readlines(logs.first).select{|line|
59
+ if line =~ /^#/
60
+ break if end_found >= 1
61
+ end_found += 1
62
+ end
63
+ changes << line
64
+ }
65
+ vars['changes'] = changes.join
66
+
67
+ # WLang template
68
+ template = File.expand_path('../debug_mail.txt', __FILE__)
69
+
70
+ # Let's go!
71
+ $stdout << WLang::file_instantiate(template, vars, "wlang/active-text")
72
+ end
73
+
74
+ rescue LoadError
75
+ task :debug_mail do
76
+ abort "wlang is not available. Try 'gem install wlang'"
77
+ end
78
+ 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
@@ -0,0 +1,22 @@
1
+ require 'rake/testtask'
2
+ desc "Lauches integration tests on layouts"
3
+ Rake::TestTask.new(:layouts) do |test|
4
+ test.libs = [ "lib", "test/unit" ]
5
+ test.test_files = [ 'test/integration/**/*.rb' ]
6
+ test.verbose = true
7
+ end
8
+
9
+ desc "Lauches integration tests on examples"
10
+ Rake::TestTask.new(:examples) do |test|
11
+ test.libs = [ "lib", "test/unit" ]
12
+ test.test_files = [ 'examples/test_all.rb' ]
13
+ test.verbose = true
14
+ end
15
+
16
+ desc "Lauches integration tests on bricks"
17
+ Rake::TestTask.new(:bricks) do |test|
18
+ test.libs = [ "lib", "test/unit" ]
19
+ test.test_files = [ 'test/bricks/test_all.rb' ]
20
+ test.verbose = true
21
+ end
22
+
@@ -0,0 +1,79 @@
1
+ # Installs a rake task for for running examples written using rspec.
2
+ #
3
+ # This file installs the 'rake spec_test' (aliased as 'rake spec') as well as
4
+ # extends 'rake test' to run spec tests, if any. It is automatically generated
5
+ # by Noe from your .noespec file, and should therefore be configured there,
6
+ # under the variables/rake_tasks/spec_test entry, as illustrated below:
7
+ #
8
+ # variables:
9
+ # rake_tasks:
10
+ # spec_test:
11
+ # pattern: spec/**/*_spec.rb
12
+ # verbose: true
13
+ # rspec_opts: [--color, --backtrace]
14
+ # ...
15
+ #
16
+ # If you have specific needs requiring manual intervention on this file,
17
+ # don't forget to set safe-override to false in your noe specification:
18
+ #
19
+ # template-info:
20
+ # manifest:
21
+ # tasks/spec_test.rake:
22
+ # safe-override: false
23
+ #
24
+ # This file has been written to conform to RSpec v2.4.0. More information about
25
+ # rspec and options of the rake task defined below can be found on
26
+ # http://relishapp.com/rspec
27
+ #
28
+ begin
29
+ require "rspec/core/rake_task"
30
+ desc "Run RSpec code examples"
31
+ RSpec::Core::RakeTask.new(:spec_test) do |t|
32
+ # Glob pattern to match files.
33
+ t.pattern = "spec/**/*_spec.rb"
34
+
35
+ # By default, if there is a Gemfile, the generated command will include
36
+ # 'bundle exec'. Set this to true to ignore the presence of a Gemfile,
37
+ # and not add 'bundle exec' to the command.
38
+ t.skip_bundler = false
39
+
40
+ # Name of Gemfile to use
41
+ t.gemfile = "Gemfile"
42
+
43
+ # Whether or not to fail Rake when an error occurs (typically when
44
+ # examples fail).
45
+ t.fail_on_error = true
46
+
47
+ # A message to print to stderr when there are failures.
48
+ t.failure_message = nil
49
+
50
+ # Use verbose output. If this is set to true, the task will print the
51
+ # executed spec command to stdout.
52
+ t.verbose = true
53
+
54
+ # Use rcov for code coverage?
55
+ t.rcov = false
56
+
57
+ # Path to rcov.
58
+ t.rcov_path = "rcov"
59
+
60
+ # Command line options to pass to rcov. See 'rcov --help' about this
61
+ t.rcov_opts = []
62
+
63
+ # Command line options to pass to ruby. See 'ruby --help' about this
64
+ t.ruby_opts = []
65
+
66
+ # Path to rspec
67
+ t.rspec_path = "rspec"
68
+
69
+ # Command line options to pass to rspec. See 'rspec --help' about this
70
+ t.rspec_opts = ["--color", "--backtrace"]
71
+ end
72
+ rescue LoadError => ex
73
+ task :spec_test do
74
+ abort 'rspec is not available. In order to run spec, you must: gem install rspec'
75
+ end
76
+ ensure
77
+ task :spec => [:spec_test]
78
+ task :test => [:spec_test]
79
+ end