Permalink
Browse files

nuke evaluator, add specdoc format as the default rake task and fix t…

…he gemspec
  • Loading branch information...
atmos committed May 27, 2008
1 parent 9dac743 commit da02ceae02f162665d40ebcac62b91183a50d6c7
Showing with 13 additions and 42 deletions.
  1. +12 −2 Rakefile
  2. +0 −1 lib/pars.rb
  3. +0 −16 lib/pars/evaluator.rb
  4. +1 −1 pars.gemspec
  5. +0 −22 spec/evaluator_spec.rb
View
@@ -47,7 +47,17 @@ task :make_spec do
file.puts spec.to_ruby
end
end
+task :default => ['specs:specdoc']
-Spec::Rake::SpecTask.new('specs') do |t|
- t.spec_files = FileList['spec/**/**/*.rb']
+namespace :specs do
+
+ Spec::Rake::SpecTask.new('run') do |t|
+ t.spec_files = FileList['spec/**/**/*.rb']
+ end
+
+ desc "Generate specdocs for examples for inclusion in RDoc"
+ Spec::Rake::SpecTask.new('specdoc') do |t|
+ t.spec_files = FileList['spec/**/**/*.rb']
+ t.spec_opts = ["--format", "specdoc"]
+ end
end
View
@@ -2,6 +2,5 @@
require 'treetop'
module Pars; end
-require File.dirname(__FILE__) + '/pars/evaluator'
require File.dirname(__FILE__) + '/pars/lvm_backup'
require File.dirname(__FILE__) + '/pars/xm'
View
@@ -1,16 +0,0 @@
-class Evaluator
- attr_reader :keys
- def initialize(string)
- @keys = { }
- eval(string)
- local_variables.reject { |var| var == 'string' }.each do |meth|
- self.class.send(:attr_reader, meth.to_sym)
- instance_variable_set("@#{meth}", eval(meth))
- end
- end
- def method_missing(name, *args, &block)
- if block_given?
- @keys[name.to_sym] = block.call
- end
- end
-end
View
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
s.description = %q{A gem that provides parse routines for various linux config file formats}
s.email = %q{cdonohoe@engineyard.com}
s.extra_rdoc_files = ["README", "LICENSE", "TODO"]
- s.files = ["LICENSE", "README", "Rakefile", "TODO", "lib/pars", "lib/pars/evaluator.rb", "lib/pars/lvm_backup", "lib/pars/lvm_backup/lvm_backup.treetop", "lib/pars/lvm_backup/lvm_backup_node_classes.rb", "lib/pars/lvm_backup.rb", "lib/pars/xm", "lib/pars/xm/info.rb", "lib/pars/xm/list.rb", "lib/pars/xm/xenstore_ls.rb", "lib/pars/xm.rb", "lib/pars.rb", "spec/evaluator_spec.rb", "spec/fixtures", "spec/fixtures/keepalived", "spec/fixtures/keepalived/keepalived.conf", "spec/fixtures/lvm_backups", "spec/fixtures/lvm_backups/ey04-data00", "spec/fixtures/lvm_backups/ey04-data01", "spec/fixtures/lvm_backups/ey04-data02", "spec/fixtures/lvm_backups/ey04-data03", "spec/fixtures/lvm_backups/ey04-data04", "spec/fixtures/lvm_backups/ey04-data05", "spec/fixtures/lvm_backups/ey04-n00-local", "spec/fixtures/xm", "spec/fixtures/xm/info", "spec/fixtures/xm/info/ey00n00.xm.info.txt", "spec/fixtures/xm/list", "spec/fixtures/xm/list/ey00n00.xm.list.txt", "spec/fixtures/xm/xenstore-ls", "spec/fixtures/xm/xenstore-ls/xenstore_ls_output.txt", "spec/integration", "spec/integration/lvm_backup_spec.rb", "spec/lvm_backups", "spec/lvm_backups/array_assignment_spec.rb", "spec/lvm_backups/blocks_spec.rb", "spec/lvm_backups/integer_assignment_spec.rb", "spec/lvm_backups/multiline_spec.rb", "spec/lvm_backups/string_assignment.rb", "spec/lvm_backups/string_literal_spec.rb", "spec/pars_spec.rb", "spec/spec_helper.rb", "spec/xm", "spec/xm/info_spec.rb", "spec/xm/list_spec.rb", "spec/xm/xenstore_ls_spec.rb"]
+ s.files = ["LICENSE", "README", "Rakefile", "TODO", "lib/pars", "lib/pars/lvm_backup", "lib/pars/lvm_backup/lvm_backup.treetop", "lib/pars/lvm_backup/lvm_backup_node_classes.rb", "lib/pars/lvm_backup.rb", "lib/pars/xm", "lib/pars/xm/info.rb", "lib/pars/xm/list.rb", "lib/pars/xm/xenstore_ls.rb", "lib/pars/xm.rb", "lib/pars.rb", "spec/fixtures", "spec/fixtures/keepalived", "spec/fixtures/keepalived/keepalived.conf", "spec/fixtures/lvm_backups", "spec/fixtures/lvm_backups/ey04-data00", "spec/fixtures/lvm_backups/ey04-data01", "spec/fixtures/lvm_backups/ey04-data02", "spec/fixtures/lvm_backups/ey04-data03", "spec/fixtures/lvm_backups/ey04-data04", "spec/fixtures/lvm_backups/ey04-data05", "spec/fixtures/lvm_backups/ey04-n00-local", "spec/fixtures/xm", "spec/fixtures/xm/info", "spec/fixtures/xm/info/ey00n00.xm.info.txt", "spec/fixtures/xm/list", "spec/fixtures/xm/list/ey00n00.xm.list.txt", "spec/fixtures/xm/xenstore-ls", "spec/fixtures/xm/xenstore-ls/xenstore_ls_output.txt", "spec/integration", "spec/integration/lvm_backup_spec.rb", "spec/lvm_backups", "spec/lvm_backups/array_assignment_spec.rb", "spec/lvm_backups/blocks_spec.rb", "spec/lvm_backups/integer_assignment_spec.rb", "spec/lvm_backups/multiline_spec.rb", "spec/lvm_backups/string_assignment.rb", "spec/lvm_backups/string_literal_spec.rb", "spec/pars_spec.rb", "spec/spec_helper.rb", "spec/xm", "spec/xm/info_spec.rb", "spec/xm/list_spec.rb", "spec/xm/xenstore_ls_spec.rb"]
s.has_rdoc = true
s.homepage = %q{http://github.com/atmos/pars/tree/master}
s.require_paths = ["lib"]
View
@@ -1,22 +0,0 @@
-require File.dirname(__FILE__) + '/spec_helper'
-
-describe Evaluator, "do it big like the rappers" do
- before(:all) do
- @test = Evaluator.new("version = 1\ntags = [\"ey02-s00327\", \"ey02-e00208\"]")
- end
- it "should respond to tags" do
- @test.should respond_to(:tags)
- end
- it "should respond to version" do
- @test.should respond_to(:version)
- end
- it "should have two instance variables" do
- @test.instance_variables.should have(3).things
- end
-
- it "should handle the first round of weird shit i throw at it" do
- @test = Evaluator.new("hello { i = 0 }")
- @test.keys[:hello] = { :i => 0 }
- end
-
-end

0 comments on commit da02cea

Please sign in to comment.