yamltest 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt ADDED
@@ -0,0 +1,13 @@
1
+ == yamltest 0.5.2 2009-05-28
2
+
3
+ * 1 minor improvement
4
+ * Added an option to disable generating 'src' from the test tile
5
+
6
+ == yamltest 0.5.1 2009-02-02
7
+
8
+ * Simplified gem specification (avoid hoe/newgem/etc dependency)
9
+
10
+ == yamltest 0.5 2009-01-21
11
+
12
+ * 1 major improvement
13
+ * First release after extraction from zena (http://zenadmin.org). [gaspard]
data/Manifest.txt ADDED
@@ -0,0 +1,15 @@
1
+ History.txt
2
+ Manifest.txt
3
+ README.rdoc
4
+ Rakefile
5
+ lib/yamltest.rb
6
+ script/console
7
+ script/destroy
8
+ script/generate
9
+ test/gem_test
10
+ test/gem_test/foo.yml
11
+ test/gem_test/simple_test.rb
12
+ test/test_helper.rb
13
+ test/test_yamltest.rb
14
+ test/yamltest/simple.yml
15
+ test/zoo/complicated.yml
data/Rakefile CHANGED
@@ -1,40 +1,123 @@
1
- require 'rubygems'
2
- require 'rake/gempackagetask'
3
- require 'rake/testtask'
4
-
5
- require 'lib/yamltest/version'
6
-
7
- task :default => :test
8
-
9
- spec = Gem::Specification.new do |s|
10
- s.name = 'yamltest'
11
- s.version = Yamltest::Version.to_s
12
- s.has_rdoc = true
13
- s.extra_rdoc_files = %w(README.rdoc)
14
- s.rdoc_options = %w(--main README.rdoc)
15
- s.summary = "yamltest lets you configure unit test with yaml documents"
16
- s.author = 'Gaspard Bucher'
17
- s.email = 'gaspard@teti.ch'
18
- s.homepage = 'http://github.com/zena/yamltest/tree'
19
- s.files = %w(README.rdoc Rakefile) + Dir.glob("{lib,test}/**/*")
20
- # s.executables = ['yamltest']
21
-
22
- # s.add_dependency('gem_name', '~> 0.0.1')
23
- end
24
-
25
- Rake::GemPackageTask.new(spec) do |pkg|
26
- pkg.gem_spec = spec
27
- end
28
-
29
- Rake::TestTask.new do |t|
30
- t.libs << 'test'
31
- t.test_files = FileList["test/*_test.rb"]
32
- t.verbose = true
33
- end
34
-
35
- desc 'Generate the gemspec to serve this Gem from Github'
36
- task :github do
37
- file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
38
- File.open(file, 'w') {|f| f << spec.to_ruby }
39
- puts "Created gemspec: #{file}"
1
+ require "rubygems"
2
+ require "rake/gempackagetask"
3
+ require "rake/rdoctask"
4
+ require 'lib/yamltest'
5
+
6
+ task :default => :test
7
+
8
+ require "rake/testtask"
9
+ Rake::TestTask.new do |t|
10
+ t.libs << "test"
11
+ t.test_files = FileList["test/**/*_test.rb"]
12
+ t.verbose = true
13
+ end
14
+
15
+ # This builds the actual gem. For details of what all these options
16
+ # mean, and other ones you can add, check the documentation here:
17
+ #
18
+ # http://rubygems.org/read/chapter/20
19
+ #
20
+ spec = Gem::Specification.new do |s|
21
+
22
+ # Change these as appropriate
23
+ s.name = "yamltest"
24
+ s.version = Yamltest::VERSION.to_s
25
+ s.summary = "yamltest lets you configure unit test with yaml documents"
26
+ s.author = 'Gaspard Bucher'
27
+ s.email = 'gaspard@teti.ch'
28
+ s.homepage = 'http://github.com/zena/yamltest/tree'
29
+
30
+ s.has_rdoc = true
31
+ s.extra_rdoc_files = %w(README.rdoc)
32
+ s.rdoc_options = %w(--main README.rdoc)
33
+
34
+ # Add any extra files to include in the gem
35
+ s.files = %w(History.txt Manifest.txt Rakefile README.rdoc) + Dir.glob("{test,lib}/**/*")
36
+
37
+ s.require_paths = ["lib"]
38
+
39
+ # If you want to depend on other gems, add them here, along with any
40
+ # relevant versions
41
+ # s.add_dependency("some_other_gem", "~> 0.1.0")
42
+
43
+ # If your tests use any gems, include them here
44
+ # s.add_development_dependency("mocha")
45
+
46
+ # If you want to publish automatically to rubyforge, you'll may need
47
+ # to tweak this, and the publishing task below too.
48
+ s.rubyforge_project = "yamltest"
49
+ end
50
+
51
+ # This task actually builds the gem. We also regenerate a static
52
+ # .gemspec file, which is useful if something (i.e. GitHub) will
53
+ # be automatically building a gem for this project. If you're not
54
+ # using GitHub, edit as appropriate.
55
+ Rake::GemPackageTask.new(spec) do |pkg|
56
+ pkg.gem_spec = spec
57
+
58
+ # Generate the gemspec file for github.
59
+ file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
60
+ File.open(file, "w") {|f| f << spec.to_ruby }
61
+ end
62
+
63
+ # Generate documentation
64
+ Rake::RDocTask.new do |rd|
65
+ rd.main = "README.rdoc"
66
+ rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
67
+ rd.rdoc_dir = "rdoc"
68
+ end
69
+
70
+ desc 'Clear out RDoc and generated packages'
71
+ task :clean => [:clobber_rdoc, :clobber_package] do
72
+ rm "#{spec.name}.gemspec"
73
+ end
74
+
75
+ # If you want to publish to RubyForge automatically, here's a simple
76
+ # task to help do that. If you don't, just get rid of this.
77
+ # Be sure to set up your Rubyforge account details with the Rubyforge
78
+ # gem; you'll need to run `rubyforge setup` and `rubyforge config` at
79
+ # the very least.
80
+ begin
81
+ require "rake/contrib/sshpublisher"
82
+ namespace :rubyforge do
83
+
84
+ desc "Release gem and RDoc documentation to RubyForge"
85
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
86
+
87
+ namespace :release do
88
+ desc "Release a new version of this gem"
89
+ task :gem => [:package] do
90
+ require 'rubyforge'
91
+ rubyforge = RubyForge.new
92
+ rubyforge.configure
93
+ rubyforge.login
94
+ rubyforge.userconfig['release_notes'] = spec.summary
95
+ path_to_gem = File.join(File.dirname(__FILE__), "pkg", "#{spec.name}-#{spec.version}.gem")
96
+ puts "Publishing #{spec.name}-#{spec.version.to_s} to Rubyforge..."
97
+ rubyforge.add_release(spec.rubyforge_project, spec.name, spec.version.to_s, path_to_gem)
98
+ end
99
+
100
+ desc "Publish RDoc to RubyForge."
101
+ task :docs => [:rdoc] do
102
+ config = YAML.load(
103
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
104
+ )
105
+
106
+ host = "#{config['username']}@rubyforge.org"
107
+ remote_dir = "/var/www/gforge-projects/yamltest/" # Should be the same as the rubyforge project name
108
+ local_dir = 'rdoc'
109
+
110
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
111
+ end
112
+ end
113
+ end
114
+ rescue LoadError
115
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
116
+ end
117
+
118
+ desc 'Generate the gemspec to serve this Gem from Github'
119
+ task :github do
120
+ file = File.dirname(__FILE__) + "/#{spec.name}.gemspec"
121
+ File.open(file, 'w') {|f| f << spec.to_ruby }
122
+ puts "Created gemspec: #{file}"
40
123
  end
data/lib/yamltest.rb CHANGED
@@ -5,7 +5,7 @@ $:.unshift(File.dirname(__FILE__)) unless
5
5
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
6
6
 
7
7
  module Yamltest
8
- VERSION = '0.5.0'
8
+ VERSION = '0.5.2'
9
9
  module Helper
10
10
  def self.included(obj)
11
11
  obj.extend Yamltest::ClassMethods
@@ -132,7 +132,7 @@ module Yamltest
132
132
  default_context = (@@test_strings[file]['default'] || {})['context'] || {}
133
133
  context = default_context.merge(context)
134
134
  when 'src'
135
- @@test_strings[file][test]['src'] || test.gsub('_',' ')
135
+ @@test_strings[file][test]['src'] #{opts[:src_from_title] != false ? "|| (test.gsub('_',' '))" : ''}
136
136
  else
137
137
  @@test_strings[file][test][key.to_s]
138
138
  end
@@ -28,7 +28,7 @@ class TestDefaultFolder < Test::Unit::TestCase
28
28
  end
29
29
 
30
30
  class TestCustomKeys < Test::Unit::TestCase
31
- yamltest :directory => 'zoo'
31
+ yamltest :directory => 'zoo', :src_from_title => true
32
32
 
33
33
  def yt_parse(key, source, context)
34
34
  res = source.gsub('o', 'a')
@@ -14,3 +14,7 @@ animal:
14
14
  context:
15
15
  foo: "bar"
16
16
  foo: "bozo"
17
+
18
+ some_title:
19
+ len: 10
20
+ res: "same title"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamltest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gaspard Bucher
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-02 00:00:00 +01:00
12
+ date: 2009-05-28 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -22,11 +22,10 @@ extensions: []
22
22
  extra_rdoc_files:
23
23
  - README.rdoc
24
24
  files:
25
- - README.rdoc
25
+ - History.txt
26
+ - Manifest.txt
26
27
  - Rakefile
27
- - lib/yamltest
28
- - lib/yamltest/version.rb
29
- - lib/yamltest.rb
28
+ - README.rdoc
30
29
  - test/gem_test
31
30
  - test/gem_test/foo.yml
32
31
  - test/gem_test/simple_test.rb
@@ -36,6 +35,9 @@ files:
36
35
  - test/yamltest_test.rb
37
36
  - test/zoo
38
37
  - test/zoo/complicated.yml
38
+ - lib/yamltest
39
+ - lib/yamltest/version.rb
40
+ - lib/yamltest.rb
39
41
  has_rdoc: true
40
42
  homepage: http://github.com/zena/yamltest/tree
41
43
  post_install_message:
@@ -58,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
60
  version:
59
61
  requirements: []
60
62
 
61
- rubyforge_project:
63
+ rubyforge_project: yamltest
62
64
  rubygems_version: 1.3.1
63
65
  signing_key:
64
66
  specification_version: 2