acts_as_markup 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,4 @@
1
+ coverage
2
+ doc
3
+ pkg
4
+ docs
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ == 1.3.4 / 2010-09-04
2
+ * Rails 3.x release
3
+
1
4
  == 1.3.3 / 2009-06-11
2
5
  * Maintenance release
3
6
 
data/README.rdoc CHANGED
@@ -5,7 +5,6 @@ by Brian Landau of Viget Labs <brian.landau@viget.com>
5
5
  GitHub Project: http://github.com/vigetlabs/acts_as_markup
6
6
 
7
7
  RDoc:
8
- * http://viget.rubyforge.org/acts_as_markup
9
8
  * http://gitrdoc.com/vigetlabs/acts_as_markup/tree/master
10
9
  * http://vigetlabs.github.com/acts_as_markup
11
10
 
@@ -41,7 +40,7 @@ what options are available.
41
40
 
42
41
  ==== Using +acts_as_markdown+:
43
42
 
44
- class Post < ActiveRecrod
43
+ class Post < ActiveRecord
45
44
  acts_as_markdown :body
46
45
  end
47
46
 
@@ -52,7 +51,7 @@ what options are available.
52
51
 
53
52
  ==== Using +acts_as_textile+:
54
53
 
55
- class Post < ActiveRecrod
54
+ class Post < ActiveRecord
56
55
  acts_as_textile :body
57
56
  end
58
57
 
@@ -63,7 +62,7 @@ what options are available.
63
62
 
64
63
  ==== Using +acts_as_wikitext+:
65
64
 
66
- class Post < ActiveRecrod
65
+ class Post < ActiveRecord
67
66
  acts_as_wikitext :body
68
67
  end
69
68
 
@@ -74,7 +73,7 @@ what options are available.
74
73
 
75
74
  ==== Using +acts_as_rdoc+:
76
75
 
77
- class Post < ActiveRecrod
76
+ class Post < ActiveRecord
78
77
  acts_as_rdoc :body
79
78
  end
80
79
 
@@ -85,7 +84,7 @@ what options are available.
85
84
 
86
85
  ==== Using +acts_as_markup+:
87
86
 
88
- class Post < ActiveRecrod
87
+ class Post < ActiveRecord
89
88
  acts_as_markup :language => :markdown, :columns => [:body]
90
89
  end
91
90
 
@@ -96,7 +95,7 @@ what options are available.
96
95
 
97
96
  ==== Using +acts_as_markup+ with <tt>:variable</tt> language:
98
97
 
99
- class Post < ActiveRecrod
98
+ class Post < ActiveRecord
100
99
  acts_as_markup :language => :variable, :columns => [:body]
101
100
  end
102
101
 
data/Rakefile CHANGED
@@ -1,33 +1,35 @@
1
1
  # Look in the tasks/setup.rb file for the various options that can be
2
2
  # configured in this Rakefile. The .rake files in the tasks directory
3
3
  # are where the options are used.
4
+ $:.unshift(File.expand_path('lib'))
4
5
 
5
- load 'tasks/setup.rb'
6
-
7
- ensure_in_path 'lib'
6
+ require 'rake'
8
7
  require 'acts_as_markup'
9
8
 
10
- task :default => 'test:run'
9
+ begin
10
+ require 'jeweler'
11
+ Jeweler::Tasks.new do |gem|
12
+ gem.name = "acts_as_markup"
13
+ gem.summary = %Q{Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML.}
14
+ gem.description = %Q{Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML.}
15
+ gem.email = "brian.landau@viget.com"
16
+ gem.homepage = "http://vigetlabs.github.com/acts_as_markup/"
17
+ gem.authors = ["Brian Landau"]
18
+ gem.version = ActsAsMarkup::VERSION
19
+ gem.add_dependency('activesupport', '>= 2.3.2')
20
+ gem.add_dependency('activerecord', '>= 2.3.2')
21
+ gem.add_dependency('rdiscount', '~> 1.3')
22
+ gem.add_dependency('wikitext', '~> 2.0')
23
+ gem.add_dependency('RedCloth', '~> 4.2')
24
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
25
+ end
26
+ Jeweler::GemcutterTasks.new
27
+ rescue LoadError
28
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
29
+ end
11
30
 
12
- PROJ.name = 'acts_as_markup'
13
- PROJ.authors = 'Brian Landau'
14
- PROJ.email = 'brian.landau@viget.com'
15
- PROJ.url = 'http://viget.rubyforge.com/acts_as_markup'
16
- PROJ.description = "Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML."
17
- PROJ.rubyforge.name = 'viget'
18
- PROJ.version = ActsAsMarkup::VERSION
19
- PROJ.rdoc.include = %w(^lib/ LICENSE CHANGELOG README\.rdoc)
20
- PROJ.rdoc.remote_dir = 'acts_as_markup'
21
- PROJ.rcov.opts = ['--no-html', '-T', '--sort coverage',
22
- '-x "\/Library\/Ruby\/"',
23
- '-x "\/opt\/local\/lib/ruby"',
24
- '-x "\/System\/Library\/"']
25
- PROJ.rcov.pattern = 'test/**/*_test.rb'
31
+ require 'tasks/test'
32
+ require 'tasks/rdoc'
26
33
 
27
- PROJ.gem.development_dependencies << ['thoughtbot-shoulda', '~> 2.0']
28
- PROJ.gem.development_dependencies << ['bones', '~> 2.5']
29
- depend_on 'activesupport', '~> 2.3.2'
30
- depend_on 'activerecord', '~> 2.3.2'
31
- depend_on 'rdiscount', '~> 1.3'
32
- depend_on 'wikitext', '~> 1.5'
33
- depend_on 'RedCloth', '~> 4.2'
34
+ task :test => :check_dependencies
35
+ task :default => :test
@@ -1,52 +1,83 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
1
4
  # -*- encoding: utf-8 -*-
2
5
 
3
6
  Gem::Specification.new do |s|
4
7
  s.name = %q{acts_as_markup}
5
- s.version = "1.3.3"
8
+ s.version = "1.3.4"
6
9
 
7
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
11
  s.authors = ["Brian Landau"]
9
- s.date = %q{2009-06-11}
12
+ s.date = %q{2010-09-04}
10
13
  s.description = %q{Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML.}
11
14
  s.email = %q{brian.landau@viget.com}
12
- s.extra_rdoc_files = ["CHANGELOG", "LICENSE", "README.rdoc"]
13
- s.files = ["CHANGELOG", "LICENSE", "README.rdoc", "Rakefile", "acts_as_markup.gemspec", "lib/acts/as_markup.rb", "lib/acts_as_markup.rb", "lib/acts_as_markup/exts/maruku.rb", "lib/acts_as_markup/exts/object.rb", "lib/acts_as_markup/exts/peg_markdown.rb", "lib/acts_as_markup/exts/rdiscount.rb", "lib/acts_as_markup/exts/rdoc.rb", "lib/acts_as_markup/exts/wikitext.rb", "lib/acts_as_markup/stringlike.rb", "tasks/bones.rake", "tasks/gem.rake", "tasks/git.rake", "tasks/post_load.rake", "tasks/rdoc.rake", "tasks/rubyforge.rake", "tasks/setup.rb", "tasks/test.rake", "test/acts_as_markdown_test.rb", "test/acts_as_markup_test.rb", "test/acts_as_rdoc_test.rb", "test/acts_as_textile_test.rb", "test/acts_as_wikitext_test.rb", "test/test_helper.rb"]
14
- s.homepage = %q{http://viget.rubyforge.com/acts_as_markup}
15
- s.rdoc_options = ["--main", "README.rdoc"]
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".gitignore",
21
+ "CHANGELOG",
22
+ "LICENSE",
23
+ "README.rdoc",
24
+ "Rakefile",
25
+ "acts_as_markup.gemspec",
26
+ "lib/acts/as_markup.rb",
27
+ "lib/acts_as_markup.rb",
28
+ "lib/acts_as_markup/exts/maruku.rb",
29
+ "lib/acts_as_markup/exts/object.rb",
30
+ "lib/acts_as_markup/exts/peg_markdown.rb",
31
+ "lib/acts_as_markup/exts/rdiscount.rb",
32
+ "lib/acts_as_markup/exts/rdoc.rb",
33
+ "lib/acts_as_markup/exts/wikitext.rb",
34
+ "lib/acts_as_markup/stringlike.rb",
35
+ "tasks/rdoc.rb",
36
+ "tasks/test.rb",
37
+ "test/acts_as_markdown_test.rb",
38
+ "test/acts_as_markup_test.rb",
39
+ "test/acts_as_rdoc_test.rb",
40
+ "test/acts_as_textile_test.rb",
41
+ "test/acts_as_wikitext_test.rb",
42
+ "test/test_helper.rb"
43
+ ]
44
+ s.homepage = %q{http://vigetlabs.github.com/acts_as_markup/}
45
+ s.rdoc_options = ["--charset=UTF-8"]
16
46
  s.require_paths = ["lib"]
17
- s.rubyforge_project = %q{viget}
18
- s.rubygems_version = %q{1.3.4}
19
- s.summary = %q{Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML}
20
- s.test_files = ["test/acts_as_markdown_test.rb", "test/acts_as_markup_test.rb", "test/acts_as_rdoc_test.rb", "test/acts_as_textile_test.rb", "test/acts_as_wikitext_test.rb"]
47
+ s.rubygems_version = %q{1.3.7}
48
+ s.summary = %q{Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML.}
49
+ s.test_files = [
50
+ "test/acts_as_markdown_test.rb",
51
+ "test/acts_as_markup_test.rb",
52
+ "test/acts_as_rdoc_test.rb",
53
+ "test/acts_as_textile_test.rb",
54
+ "test/acts_as_wikitext_test.rb",
55
+ "test/test_helper.rb"
56
+ ]
21
57
 
22
58
  if s.respond_to? :specification_version then
23
59
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
24
60
  s.specification_version = 3
25
61
 
26
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
27
- s.add_runtime_dependency(%q<activesupport>, ["~> 2.3.2"])
28
- s.add_runtime_dependency(%q<activerecord>, ["~> 2.3.2"])
62
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
63
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3.2"])
64
+ s.add_runtime_dependency(%q<activerecord>, [">= 2.3.2"])
29
65
  s.add_runtime_dependency(%q<rdiscount>, ["~> 1.3"])
30
- s.add_runtime_dependency(%q<wikitext>, ["~> 1.5"])
66
+ s.add_runtime_dependency(%q<wikitext>, ["~> 2.0"])
31
67
  s.add_runtime_dependency(%q<RedCloth>, ["~> 4.2"])
32
- s.add_development_dependency(%q<thoughtbot-shoulda>, ["~> 2.0"])
33
- s.add_development_dependency(%q<bones>, ["~> 2.5"])
34
68
  else
35
- s.add_dependency(%q<activesupport>, ["~> 2.3.2"])
36
- s.add_dependency(%q<activerecord>, ["~> 2.3.2"])
69
+ s.add_dependency(%q<activesupport>, [">= 2.3.2"])
70
+ s.add_dependency(%q<activerecord>, [">= 2.3.2"])
37
71
  s.add_dependency(%q<rdiscount>, ["~> 1.3"])
38
- s.add_dependency(%q<wikitext>, ["~> 1.5"])
72
+ s.add_dependency(%q<wikitext>, ["~> 2.0"])
39
73
  s.add_dependency(%q<RedCloth>, ["~> 4.2"])
40
- s.add_dependency(%q<thoughtbot-shoulda>, ["~> 2.0"])
41
- s.add_dependency(%q<bones>, ["~> 2.5"])
42
74
  end
43
75
  else
44
- s.add_dependency(%q<activesupport>, ["~> 2.3.2"])
45
- s.add_dependency(%q<activerecord>, ["~> 2.3.2"])
76
+ s.add_dependency(%q<activesupport>, [">= 2.3.2"])
77
+ s.add_dependency(%q<activerecord>, [">= 2.3.2"])
46
78
  s.add_dependency(%q<rdiscount>, ["~> 1.3"])
47
- s.add_dependency(%q<wikitext>, ["~> 1.5"])
79
+ s.add_dependency(%q<wikitext>, ["~> 2.0"])
48
80
  s.add_dependency(%q<RedCloth>, ["~> 4.2"])
49
- s.add_dependency(%q<thoughtbot-shoulda>, ["~> 2.0"])
50
- s.add_dependency(%q<bones>, ["~> 2.5"])
51
81
  end
52
82
  end
83
+
@@ -1,8 +1,10 @@
1
+ require 'set'
1
2
  require 'active_support'
3
+ require 'active_support/core_ext'
2
4
 
3
5
  module ActsAsMarkup
4
6
  # :stopdoc:
5
- VERSION = '1.3.3'.freeze
7
+ VERSION = '1.3.4'.freeze
6
8
  LIBPATH = ::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
7
9
  PATH = ::File.dirname(LIBPATH) + ::File::SEPARATOR
8
10
  # :startdoc:
@@ -26,7 +28,7 @@ module ActsAsMarkup
26
28
  :maruku => {:class_name => "Maruku",
27
29
  :lib_name => "maruku"} }
28
30
 
29
- LIBRARY_EXTENSIONS = Set.new(Dir[ActsAsMarkup::LIBPATH + 'acts_as_markup/exts/*.rb'].map {|file| File.basename(file, '.rb')}).delete('string')
31
+ LIBRARY_EXTENSIONS = ::Set.new(Dir[ActsAsMarkup::LIBPATH + 'acts_as_markup/exts/*.rb'].map {|file| File.basename(file, '.rb')}).delete('string')
30
32
 
31
33
  @@markdown_library = DEFAULT_MARKDOWN_LIB
32
34
  mattr_accessor :markdown_library
data/tasks/rdoc.rb ADDED
@@ -0,0 +1,13 @@
1
+ begin
2
+ gem 'brianjlandau-sdoc-helpers'
3
+ require 'sdoc_helpers'
4
+ require 'rake/sdoctask'
5
+
6
+ Rake::SDocTask.new do |rdoc|
7
+ version = ActsAsMarkup::VERSION
8
+ rdoc.title = "ActsAsMarkup #{version} Documentation"
9
+ rdoc.rdoc_files.include('lib/**/*.rb')
10
+ end
11
+ rescue LoadError
12
+ puts "sdoc RDoc tasks not loaded. Please intall sdoc."
13
+ end
data/tasks/test.rb ADDED
@@ -0,0 +1,17 @@
1
+ require 'rake/testtask'
2
+ Rake::TestTask.new(:test) do |test|
3
+ test.libs << 'lib' << 'test'
4
+ test.pattern = 'test/**/*_test.rb'
5
+ test.verbose = true
6
+ end
7
+
8
+ begin
9
+ require 'rcov/rcovtask'
10
+ Rcov::RcovTask.new do |test|
11
+ test.libs << 'test'
12
+ test.pattern = 'test/**/*_test.rb'
13
+ test.verbose = true
14
+ test.rcov_opts = %w[--sort coverage -T --only-uncovered]
15
+ end
16
+ rescue LoadError
17
+ end
@@ -92,11 +92,11 @@ class ActsAsMarkdownTest < ActsAsMarkupTestCase
92
92
  end
93
93
 
94
94
  should_act_like_a_string
95
-
95
+
96
96
  should "have a Ruby PEG Markdown object returned for the column value" do
97
97
  assert_kind_of PEGMarkdown, @post.body
98
98
  end
99
-
99
+
100
100
  should "return original markdown text for a `to_s` method call on the column value" do
101
101
  assert_equal @markdown_text, @post.body.to_s
102
102
  end
@@ -104,7 +104,7 @@ class ActsAsMarkdownTest < ActsAsMarkupTestCase
104
104
  should 'return false for .blank?' do
105
105
  assert !@post.body.blank?
106
106
  end
107
-
107
+
108
108
  should "return formated html for a `to_html` method call on the column value" do
109
109
  assert_match(/<h2(\s\w+\=['"]\w*['"])*\s*>\s*Markdown Test Text\s*<\/h2>/, @post.body.to_html)
110
110
  end
@@ -113,37 +113,37 @@ class ActsAsMarkdownTest < ActsAsMarkupTestCase
113
113
  @post.body = "## Markdown <i>Test</i> Text"
114
114
  assert_match(/<i>Test<\/i>/, @post.body.to_html)
115
115
  end
116
-
116
+
117
117
  context "changing value of markdown field should return new markdown object" do
118
118
  setup do
119
119
  @old_body = @post.body
120
120
  @post.body = "`@count = 20`"
121
121
  end
122
-
122
+
123
123
  should "still have an PEGMarkdown object but not the same object" do
124
124
  assert_kind_of PEGMarkdown, @post.body
125
125
  assert_not_same @post.body, @old_body
126
126
  end
127
-
127
+
128
128
  should "return correct text for `to_s`" do
129
129
  assert_equal "`@count = 20`", @post.body.to_s
130
130
  end
131
-
131
+
132
132
  should "return correct HTML for the `to_html` method" do
133
133
  assert_match(/<code>\s*\@count\s\=\s20\s*<\/code>/, @post.body.to_html)
134
134
  end
135
-
135
+
136
136
  teardown do
137
137
  @old_body = nil
138
138
  end
139
139
  end
140
-
140
+
141
141
  teardown do
142
142
  @post = nil
143
143
  Post.delete_all
144
144
  end
145
145
  end
146
-
146
+
147
147
  context 'using Ruby PEG Markdown with options' do
148
148
  setup do
149
149
  class ::Post
@@ -210,7 +210,7 @@ class ActsAsMarkupTest < ActsAsMarkupTestCase
210
210
  end
211
211
 
212
212
  should "return correct HTML for the `to_html` method" do
213
- assert_match(/<tt>\@count\s\=\s20<\/tt>/, @wikitext_post.body.to_html)
213
+ assert_match(/<p><code>\@count\s\=\s20<\/code><\/p>/, @wikitext_post.body.to_html)
214
214
  end
215
215
 
216
216
  teardown do
@@ -47,7 +47,7 @@ class ActsAsWikitextTest < ActsAsMarkupTestCase
47
47
  end
48
48
 
49
49
  should "return correct HTML for the `to_html` method" do
50
- assert_match(/<tt>\@count\s\=\s20<\/tt>/, @post.body.to_html)
50
+ assert_match(/<p><code>\@count\s\=\s20<\/code><\/p>/, @post.body.to_html)
51
51
  end
52
52
 
53
53
  teardown do
data/test/test_helper.rb CHANGED
@@ -7,7 +7,7 @@ require 'active_support/test_case'
7
7
  require File.expand_path( File.join(File.dirname(__FILE__), %w[.. lib acts_as_markup]) )
8
8
  ActiveRecord::Schema.verbose = false
9
9
 
10
- ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :dbfile => ":memory:")
10
+ ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => ":memory:")
11
11
 
12
12
  def setup_db
13
13
  ActiveRecord::Schema.define(:version => 1) do
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_markup
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ hash: 19
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 3
9
+ - 4
10
+ version: 1.3.4
5
11
  platform: ruby
6
12
  authors:
7
13
  - Brian Landau
@@ -9,79 +15,86 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-06-11 00:00:00 -04:00
18
+ date: 2010-09-04 00:00:00 -04:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: activesupport
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
- - - ~>
27
+ - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 2
32
+ - 3
33
+ - 2
23
34
  version: 2.3.2
24
- version:
35
+ type: :runtime
36
+ version_requirements: *id001
25
37
  - !ruby/object:Gem::Dependency
26
38
  name: activerecord
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
30
42
  requirements:
31
- - - ~>
43
+ - - ">="
32
44
  - !ruby/object:Gem::Version
45
+ hash: 7
46
+ segments:
47
+ - 2
48
+ - 3
49
+ - 2
33
50
  version: 2.3.2
34
- version:
51
+ type: :runtime
52
+ version_requirements: *id002
35
53
  - !ruby/object:Gem::Dependency
36
54
  name: rdiscount
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
40
58
  requirements:
41
59
  - - ~>
42
60
  - !ruby/object:Gem::Version
61
+ hash: 9
62
+ segments:
63
+ - 1
64
+ - 3
43
65
  version: "1.3"
44
- version:
66
+ type: :runtime
67
+ version_requirements: *id003
45
68
  - !ruby/object:Gem::Dependency
46
69
  name: wikitext
47
- type: :runtime
48
- version_requirement:
49
- version_requirements: !ruby/object:Gem::Requirement
70
+ prerelease: false
71
+ requirement: &id004 !ruby/object:Gem::Requirement
72
+ none: false
50
73
  requirements:
51
74
  - - ~>
52
75
  - !ruby/object:Gem::Version
53
- version: "1.5"
54
- version:
76
+ hash: 3
77
+ segments:
78
+ - 2
79
+ - 0
80
+ version: "2.0"
81
+ type: :runtime
82
+ version_requirements: *id004
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: RedCloth
57
- type: :runtime
58
- version_requirement:
59
- version_requirements: !ruby/object:Gem::Requirement
85
+ prerelease: false
86
+ requirement: &id005 !ruby/object:Gem::Requirement
87
+ none: false
60
88
  requirements:
61
89
  - - ~>
62
90
  - !ruby/object:Gem::Version
91
+ hash: 31
92
+ segments:
93
+ - 4
94
+ - 2
63
95
  version: "4.2"
64
- version:
65
- - !ruby/object:Gem::Dependency
66
- name: thoughtbot-shoulda
67
- type: :development
68
- version_requirement:
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ~>
72
- - !ruby/object:Gem::Version
73
- version: "2.0"
74
- version:
75
- - !ruby/object:Gem::Dependency
76
- name: bones
77
- type: :development
78
- version_requirement:
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - ~>
82
- - !ruby/object:Gem::Version
83
- version: "2.5"
84
- version:
96
+ type: :runtime
97
+ version_requirements: *id005
85
98
  description: Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML.
86
99
  email: brian.landau@viget.com
87
100
  executables: []
@@ -89,10 +102,10 @@ executables: []
89
102
  extensions: []
90
103
 
91
104
  extra_rdoc_files:
92
- - CHANGELOG
93
105
  - LICENSE
94
106
  - README.rdoc
95
107
  files:
108
+ - .gitignore
96
109
  - CHANGELOG
97
110
  - LICENSE
98
111
  - README.rdoc
@@ -107,14 +120,8 @@ files:
107
120
  - lib/acts_as_markup/exts/rdoc.rb
108
121
  - lib/acts_as_markup/exts/wikitext.rb
109
122
  - lib/acts_as_markup/stringlike.rb
110
- - tasks/bones.rake
111
- - tasks/gem.rake
112
- - tasks/git.rake
113
- - tasks/post_load.rake
114
- - tasks/rdoc.rake
115
- - tasks/rubyforge.rake
116
- - tasks/setup.rb
117
- - tasks/test.rake
123
+ - tasks/rdoc.rb
124
+ - tasks/test.rb
118
125
  - test/acts_as_markdown_test.rb
119
126
  - test/acts_as_markup_test.rb
120
127
  - test/acts_as_rdoc_test.rb
@@ -122,37 +129,43 @@ files:
122
129
  - test/acts_as_wikitext_test.rb
123
130
  - test/test_helper.rb
124
131
  has_rdoc: true
125
- homepage: http://viget.rubyforge.com/acts_as_markup
132
+ homepage: http://vigetlabs.github.com/acts_as_markup/
126
133
  licenses: []
127
134
 
128
135
  post_install_message:
129
136
  rdoc_options:
130
- - --main
131
- - README.rdoc
137
+ - --charset=UTF-8
132
138
  require_paths:
133
139
  - lib
134
140
  required_ruby_version: !ruby/object:Gem::Requirement
141
+ none: false
135
142
  requirements:
136
143
  - - ">="
137
144
  - !ruby/object:Gem::Version
145
+ hash: 3
146
+ segments:
147
+ - 0
138
148
  version: "0"
139
- version:
140
149
  required_rubygems_version: !ruby/object:Gem::Requirement
150
+ none: false
141
151
  requirements:
142
152
  - - ">="
143
153
  - !ruby/object:Gem::Version
154
+ hash: 3
155
+ segments:
156
+ - 0
144
157
  version: "0"
145
- version:
146
158
  requirements: []
147
159
 
148
- rubyforge_project: viget
149
- rubygems_version: 1.3.4
160
+ rubyforge_project:
161
+ rubygems_version: 1.3.7
150
162
  signing_key:
151
163
  specification_version: 3
152
- summary: Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML
164
+ summary: Represent ActiveRecord Markdown, Textile, Wiki text, RDoc columns as Markdown, Textile Wikitext, RDoc objects using various external libraries to convert to HTML.
153
165
  test_files:
154
166
  - test/acts_as_markdown_test.rb
155
167
  - test/acts_as_markup_test.rb
156
168
  - test/acts_as_rdoc_test.rb
157
169
  - test/acts_as_textile_test.rb
158
170
  - test/acts_as_wikitext_test.rb
171
+ - test/test_helper.rb
data/tasks/bones.rake DELETED
@@ -1,21 +0,0 @@
1
- # $Id$
2
-
3
- if HAVE_BONES
4
-
5
- namespace :bones do
6
-
7
- desc 'Show the PROJ open struct'
8
- task :debug do |t|
9
- atr = if t.application.top_level_tasks.length == 2
10
- t.application.top_level_tasks.pop
11
- end
12
-
13
- if atr then Bones::Debug.show_attr(PROJ, atr)
14
- else Bones::Debug.show PROJ end
15
- end
16
-
17
- end # namespace :bones
18
-
19
- end # HAVE_BONES
20
-
21
- # EOF
data/tasks/gem.rake DELETED
@@ -1,201 +0,0 @@
1
-
2
- require 'find'
3
- require 'rake/packagetask'
4
- require 'rubygems/user_interaction'
5
- require 'rubygems/builder'
6
-
7
- module Bones
8
- class GemPackageTask < Rake::PackageTask
9
- # Ruby GEM spec containing the metadata for this package. The
10
- # name, version and package_files are automatically determined
11
- # from the GEM spec and don't need to be explicitly provided.
12
- #
13
- attr_accessor :gem_spec
14
-
15
- # Tasks from the Bones gem directory
16
- attr_reader :bones_files
17
-
18
- # Create a GEM Package task library. Automatically define the gem
19
- # if a block is given. If no block is supplied, then +define+
20
- # needs to be called to define the task.
21
- #
22
- def initialize(gem_spec)
23
- init(gem_spec)
24
- yield self if block_given?
25
- define if block_given?
26
- end
27
-
28
- # Initialization tasks without the "yield self" or define
29
- # operations.
30
- #
31
- def init(gem)
32
- super(gem.name, gem.version)
33
- @gem_spec = gem
34
- @package_files += gem_spec.files if gem_spec.files
35
- @bones_files = []
36
-
37
- local_setup = File.join(Dir.pwd, %w[tasks setup.rb])
38
- if !test(?e, local_setup)
39
- Dir.glob(::Bones.path(%w[lib bones tasks *])).each {|fn| bones_files << fn}
40
- end
41
- end
42
-
43
- # Create the Rake tasks and actions specified by this
44
- # GemPackageTask. (+define+ is automatically called if a block is
45
- # given to +new+).
46
- #
47
- def define
48
- super
49
- task :prereqs
50
- task :package => ['gem:prereqs', "#{package_dir_path}/#{gem_file}"]
51
- file "#{package_dir_path}/#{gem_file}" => [package_dir_path] + package_files + bones_files do
52
- when_writing("Creating GEM") {
53
- chdir(package_dir_path) do
54
- Gem::Builder.new(gem_spec).build
55
- verbose(true) {
56
- mv gem_file, "../#{gem_file}"
57
- }
58
- end
59
- }
60
- end
61
-
62
- file package_dir_path => bones_files do
63
- mkdir_p package_dir rescue nil
64
-
65
- gem_spec.files = (gem_spec.files +
66
- bones_files.map {|fn| File.join('tasks', File.basename(fn))}).sort
67
-
68
- bones_files.each do |fn|
69
- base_fn = File.join('tasks', File.basename(fn))
70
- f = File.join(package_dir_path, base_fn)
71
- fdir = File.dirname(f)
72
- mkdir_p(fdir) if !File.exist?(fdir)
73
- if File.directory?(fn)
74
- mkdir_p(f)
75
- else
76
- raise "file name conflict for '#{base_fn}' (conflicts with '#{fn}')" if test(?e, f)
77
- safe_ln(fn, f)
78
- end
79
- end
80
- end
81
- end
82
-
83
- def gem_file
84
- if @gem_spec.platform == Gem::Platform::RUBY
85
- "#{package_name}.gem"
86
- else
87
- "#{package_name}-#{@gem_spec.platform}.gem"
88
- end
89
- end
90
- end # class GemPackageTask
91
- end # module Bones
92
-
93
- namespace :gem do
94
-
95
- PROJ.gem._spec = Gem::Specification.new do |s|
96
- s.name = PROJ.name
97
- s.version = PROJ.version
98
- s.summary = PROJ.summary
99
- s.authors = Array(PROJ.authors)
100
- s.email = PROJ.email
101
- s.homepage = Array(PROJ.url).first
102
- s.rubyforge_project = PROJ.rubyforge.name
103
-
104
- s.description = PROJ.description
105
-
106
- PROJ.gem.dependencies.each do |dep|
107
- s.add_dependency(*dep)
108
- end
109
-
110
- PROJ.gem.development_dependencies.each do |dep|
111
- s.add_development_dependency(*dep)
112
- end
113
-
114
- s.files = PROJ.gem.files
115
- s.executables = PROJ.gem.executables.map {|fn| File.basename(fn)}
116
- s.extensions = PROJ.gem.files.grep %r/extconf\.rb$/
117
-
118
- s.bindir = 'bin'
119
- dirs = Dir["{#{PROJ.libs.join(',')}}"]
120
- s.require_paths = dirs unless dirs.empty?
121
-
122
- incl = Regexp.new(PROJ.rdoc.include.join('|'))
123
- excl = PROJ.rdoc.exclude.dup.concat %w[\.rb$ ^(\.\/|\/)?ext]
124
- excl = Regexp.new(excl.join('|'))
125
- rdoc_files = PROJ.gem.files.find_all do |fn|
126
- case fn
127
- when excl; false
128
- when incl; true
129
- else false end
130
- end
131
- s.rdoc_options = PROJ.rdoc.opts + ['--main', PROJ.rdoc.main]
132
- s.extra_rdoc_files = rdoc_files
133
- s.has_rdoc = true
134
-
135
- if test ?f, PROJ.test.file
136
- s.test_file = PROJ.test.file
137
- else
138
- s.test_files = PROJ.test.files.to_a
139
- end
140
-
141
- # Do any extra stuff the user wants
142
- PROJ.gem.extras.each do |msg, val|
143
- case val
144
- when Proc
145
- val.call(s.send(msg))
146
- else
147
- s.send "#{msg}=", val
148
- end
149
- end
150
- end # Gem::Specification.new
151
-
152
- Bones::GemPackageTask.new(PROJ.gem._spec) do |pkg|
153
- pkg.need_tar = PROJ.gem.need_tar
154
- pkg.need_zip = PROJ.gem.need_zip
155
- end
156
-
157
- desc 'Show information about the gem'
158
- task :debug => 'gem:prereqs' do
159
- puts PROJ.gem._spec.to_ruby
160
- end
161
-
162
- desc 'Write the gemspec '
163
- task :spec => 'gem:prereqs' do
164
- File.open("#{PROJ.name}.gemspec", 'w') do |f|
165
- f.write PROJ.gem._spec.to_ruby
166
- end
167
- end
168
-
169
- desc 'Install the gem'
170
- task :install => [:clobber, 'gem:package'] do
171
- sh "#{SUDO} #{GEM} install --local pkg/#{PROJ.gem._spec.full_name}"
172
-
173
- # use this version of the command for rubygems > 1.0.0
174
- #sh "#{SUDO} #{GEM} install --no-update-sources pkg/#{PROJ.gem._spec.full_name}"
175
- end
176
-
177
- desc 'Uninstall the gem'
178
- task :uninstall do
179
- installed_list = Gem.source_index.find_name(PROJ.name)
180
- if installed_list and installed_list.collect { |s| s.version.to_s}.include?(PROJ.version) then
181
- sh "#{SUDO} #{GEM} uninstall --version '#{PROJ.version}' --ignore-dependencies --executables #{PROJ.name}"
182
- end
183
- end
184
-
185
- desc 'Reinstall the gem'
186
- task :reinstall => [:uninstall, :install]
187
-
188
- desc 'Cleanup the gem'
189
- task :cleanup do
190
- sh "#{SUDO} #{GEM} cleanup #{PROJ.gem._spec.name}"
191
- end
192
- end # namespace :gem
193
-
194
-
195
- desc 'Alias to gem:package'
196
- task :gem => 'gem:package'
197
-
198
- task :clobber => 'gem:clobber_package'
199
- remove_desc_for_task 'gem:clobber_package'
200
-
201
- # EOF
data/tasks/git.rake DELETED
@@ -1,41 +0,0 @@
1
- # $Id$
2
-
3
- if HAVE_GIT
4
-
5
- namespace :git do
6
-
7
- # A prerequisites task that all other tasks depend upon
8
- task :prereqs
9
-
10
- desc 'Show tags from the Git repository'
11
- task :show_tags => 'git:prereqs' do |t|
12
- puts %x/git tag/
13
- end
14
-
15
- desc 'Create a new tag in the Git repository'
16
- task :create_tag => 'git:prereqs' do |t|
17
- v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
18
- abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
19
-
20
- tag = PROJ.version.to_s
21
- msg = "Creating tag for #{PROJ.name} version #{PROJ.version}"
22
-
23
- puts "Creating Git tag '#{tag}'"
24
- unless system "git tag -a -m '#{msg}' #{tag}"
25
- abort "Tag creation failed"
26
- end
27
-
28
- if %x/git remote/ =~ %r/^origin\s*$/
29
- unless system "git push origin #{tag}"
30
- abort "Could not push tag to remote Git repository"
31
- end
32
- end
33
- end
34
-
35
- end # namespace :git
36
-
37
- task 'gem:release' => 'git:create_tag'
38
-
39
- end # if HAVE_GIT
40
-
41
- # EOF
data/tasks/post_load.rake DELETED
@@ -1,32 +0,0 @@
1
-
2
- # This file does not define any rake tasks. It is used to load some project
3
- # settings if they are not defined by the user.
4
-
5
- PROJ.exclude << ["^#{Regexp.escape(PROJ.rdoc.dir)}/",
6
- "^#{Regexp.escape(PROJ.rcov.dir)}/"]
7
-
8
- flatten_arrays = lambda do |this,os|
9
- os.instance_variable_get(:@table).each do |key,val|
10
- next if key == :dependencies \
11
- or key == :development_dependencies
12
- case val
13
- when Array; val.flatten!
14
- when OpenStruct; this.call(this,val)
15
- end
16
- end
17
- end
18
- flatten_arrays.call(flatten_arrays,PROJ)
19
-
20
- PROJ.changes ||= paragraphs_of(PROJ.history_file, 0..1).join("\n\n")
21
-
22
- PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
23
-
24
- PROJ.summary ||= PROJ.description.split('.').first
25
-
26
- PROJ.gem.files ||= manifest
27
-
28
- PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
29
-
30
- PROJ.rdoc.main ||= PROJ.readme_file
31
-
32
- # EOF
data/tasks/rdoc.rake DELETED
@@ -1,51 +0,0 @@
1
- # $Id$
2
-
3
- require 'sdoc'
4
- require 'rake/rdoctask'
5
-
6
- namespace :doc do
7
-
8
- desc 'Generate RDoc documentation'
9
- Rake::RDocTask.new do |rd|
10
- rdoc = PROJ.rdoc
11
- rd.main = rdoc.main || PROJ.readme_file
12
- rd.rdoc_dir = rdoc.dir
13
-
14
- incl = Regexp.new(rdoc.include.join('|'))
15
- excl = Regexp.new(rdoc.exclude.join('|'))
16
- files = PROJ.gem.files.find_all do |fn|
17
- case fn
18
- when excl; false
19
- when incl; true
20
- else false end
21
- end
22
- rd.rdoc_files.push(*files)
23
-
24
- title = "#{PROJ.name}-#{PROJ.version} Documentation"
25
-
26
- rd.options << "-t #{title}"
27
- rd.options << '--fmt' << 'shtml' # explictly set shtml generator
28
- rd.template = 'direct'
29
- rd.options.concat(rdoc.opts)
30
- end
31
-
32
- desc 'Generate ri locally for testing'
33
- task :ri => :clobber_ri do
34
- sh "#{RDOC} --ri -o ri ."
35
- end
36
-
37
- task :clobber_ri do
38
- rm_r 'ri' rescue nil
39
- end
40
-
41
- end # namespace :doc
42
-
43
- desc 'Alias to doc:rdoc'
44
- task :doc => 'doc:rdoc'
45
-
46
- desc 'Remove all build products'
47
- task :clobber => %w(doc:clobber_rdoc doc:clobber_ri)
48
-
49
- remove_desc_for_task %w(doc:clobber_rdoc)
50
-
51
- # EOF
data/tasks/rubyforge.rake DELETED
@@ -1,55 +0,0 @@
1
-
2
- if PROJ.rubyforge.name.valid? && HAVE_RUBYFORGE
3
-
4
- require 'rubyforge'
5
- require 'rake/contrib/sshpublisher'
6
-
7
- namespace :gem do
8
- desc 'Package and upload to RubyForge'
9
- task :release => [:clobber, 'gem'] do |t|
10
- v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
11
- abort "Versions don't match #{v} vs #{PROJ.version}" if v != PROJ.version
12
- pkg = "pkg/#{PROJ.gem._spec.full_name}"
13
-
14
- if $DEBUG then
15
- puts "release_id = rf.add_release #{PROJ.rubyforge.name.inspect}, #{PROJ.name.inspect}, #{PROJ.version.inspect}, \"#{pkg}.tgz\""
16
- puts "rf.add_file #{PROJ.rubyforge.name.inspect}, #{PROJ.name.inspect}, release_id, \"#{pkg}.gem\""
17
- end
18
-
19
- rf = RubyForge.new
20
- rf.configure rescue nil
21
- puts 'Logging in'
22
- rf.login
23
-
24
- c = rf.userconfig
25
- c['release_notes'] = PROJ.description if PROJ.description
26
- c['release_changes'] = PROJ.changes if PROJ.changes
27
- c['preformatted'] = true
28
-
29
- files = Dir.glob("#{pkg}*.*")
30
-
31
- puts "Releasing #{PROJ.name} v. #{PROJ.version}"
32
- rf.add_release PROJ.rubyforge.name, PROJ.name, PROJ.version, *files
33
- end
34
- end # namespace :gem
35
-
36
-
37
- namespace :doc do
38
- desc "Publish RDoc to RubyForge"
39
- task :release => %w(doc:clobber_rdoc doc:rdoc) do
40
- config = YAML.load(
41
- File.read(File.expand_path('~/.rubyforge/user-config.yml'))
42
- )
43
-
44
- host = "#{config['username']}@rubyforge.org"
45
- remote_dir = "/var/www/gforge-projects/#{PROJ.rubyforge.name}/"
46
- remote_dir << PROJ.rdoc.remote_dir if PROJ.rdoc.remote_dir
47
- local_dir = PROJ.rdoc.dir
48
-
49
- Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
50
- end
51
- end # namespace :doc
52
-
53
- end # if HAVE_RUBYFORGE
54
-
55
- # EOF
data/tasks/setup.rb DELETED
@@ -1,249 +0,0 @@
1
- # $Id$
2
-
3
- require 'rubygems'
4
- require 'rake'
5
- require 'rake/clean'
6
- require 'fileutils'
7
- require 'ostruct'
8
- require 'find'
9
-
10
- class OpenStruct; undef :gem if defined? :gem; end
11
-
12
- PROJ = OpenStruct.new(
13
- # Project Defaults
14
- :name => nil,
15
- :summary => nil,
16
- :description => nil,
17
- :changes => nil,
18
- :authors => nil,
19
- :email => nil,
20
- :url => "\000",
21
- :version => ENV['VERSION'] || '0.0.0',
22
- :exclude => %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ ^pkg/),
23
- :release_name => ENV['RELEASE'],
24
-
25
- # System Defaults
26
- :ruby_opts => %w(-w),
27
- :libs => [],
28
- :history_file => 'CHANGELOG',
29
- :readme_file => 'README.rdoc',
30
- :ignore_file => '.gitignore',
31
-
32
- # Gem Packaging
33
- :gem => OpenStruct.new(
34
- :dependencies => [],
35
- :development_dependencies => [],
36
- :executables => nil,
37
- :extensions => FileList['ext/**/extconf.rb'],
38
- :files => nil,
39
- :need_tar => true,
40
- :need_zip => false,
41
- :extras => {}
42
- ),
43
-
44
- # File Annotations
45
- :notes => OpenStruct.new(
46
- :exclude => %w(^tasks/setup\.rb$),
47
- :extensions => %w(.txt .rb .erb) << '',
48
- :tags => %w(FIXME OPTIMIZE TODO)
49
- ),
50
-
51
- # Rcov
52
- :rcov => OpenStruct.new(
53
- :dir => 'coverage',
54
- :opts => %w[--sort coverage -T --no-html]
55
- ),
56
-
57
- # Rdoc
58
- :rdoc => OpenStruct.new(
59
- :opts => [],
60
- :include => %w(^lib/ ^bin/ ^ext/ \.txt$),
61
- :exclude => %w(extconf\.rb$),
62
- :main => nil,
63
- :dir => 'doc',
64
- :remote_dir => nil
65
- ),
66
-
67
- # Rubyforge
68
- :rubyforge => OpenStruct.new(
69
- :name => "\000"
70
- ),
71
-
72
- # Test::Unit
73
- :test => OpenStruct.new(
74
- :files => FileList['test/**/*_test.rb'],
75
- :file => 'test/all.rb',
76
- :opts => []
77
- )
78
- )
79
-
80
- # Load the other rake files in the tasks folder
81
- tasks_dir = File.expand_path(File.dirname(__FILE__))
82
- post_load_fn = File.join(tasks_dir, 'post_load.rake')
83
- rakefiles = Dir.glob(File.join(tasks_dir, '*.rake')).sort
84
- rakefiles.unshift(rakefiles.delete(post_load_fn)).compact!
85
- import(*rakefiles)
86
-
87
- # Setup the project libraries
88
- %w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
89
-
90
- # Setup some constants
91
- DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
92
-
93
- def quiet( &block )
94
- io = [STDOUT.dup, STDERR.dup]
95
- STDOUT.reopen DEV_NULL
96
- STDERR.reopen DEV_NULL
97
- block.call
98
- ensure
99
- STDOUT.reopen io.first
100
- STDERR.reopen io.last
101
- $stdout, $stderr = STDOUT, STDERR
102
- end
103
-
104
- DIFF = if system("gdiff '#{__FILE__}' '#{__FILE__}' > #{DEV_NULL} 2>&1") then 'gdiff'
105
- else 'diff' end unless defined? DIFF
106
-
107
- SUDO = if system("which sudo > #{DEV_NULL} 2>&1") then 'sudo'
108
- else '' end unless defined? SUDO
109
-
110
- RCOV = "#{RUBY} -S rcov"
111
- RDOC = "#{RUBY} -S rdoc"
112
- GEM = "#{RUBY} -S gem"
113
-
114
- %w(rcov rubyforge bones facets/ansicode).each do |lib|
115
- begin
116
- require lib
117
- Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", true}
118
- rescue LoadError
119
- Object.instance_eval {const_set "HAVE_#{lib.tr('/','_').upcase}", false}
120
- end
121
- end
122
- HAVE_GIT = (Dir.entries(Dir.pwd).include?('.git') and
123
- system("git --version 2>&1 > #{DEV_NULL}"))
124
-
125
- # Reads a file at +path+ and spits out an array of the +paragraphs+
126
- # specified.
127
- #
128
- # changes = paragraphs_of('History.txt', 0..1).join("\n\n")
129
- # summary, *description = paragraphs_of('README.txt', 3, 3..8)
130
- #
131
- def paragraphs_of( path, *paragraphs )
132
- title = String === paragraphs.first ? paragraphs.shift : nil
133
- ary = File.read(path).delete("\r").split(/\n\n+/)
134
-
135
- result = if title
136
- tmp, matching = [], false
137
- rgxp = %r/^=+\s*#{Regexp.escape(title)}/i
138
- paragraphs << (0..-1) if paragraphs.empty?
139
-
140
- ary.each do |val|
141
- if val =~ rgxp
142
- break if matching
143
- matching = true
144
- rgxp = %r/^=+/i
145
- elsif matching
146
- tmp << val
147
- end
148
- end
149
- tmp
150
- else ary end
151
-
152
- result.values_at(*paragraphs)
153
- end
154
-
155
- # Adds the given gem _name_ to the current project's dependency list. An
156
- # optional gem _version_ can be given. If omitted, the newest gem version
157
- # will be used.
158
- #
159
- def depend_on( name, version = nil )
160
- spec = Gem.source_index.find_name(name).last
161
- version = spec.version.to_s if version.nil? and !spec.nil?
162
-
163
- PROJ.gem.dependencies << case version
164
- when nil; [name]
165
- when %r/^\d/; [name, ">= #{version}"]
166
- else [name, version] end
167
- end
168
-
169
- # Adds the given arguments to the include path if they are not already there
170
- #
171
- def ensure_in_path( *args )
172
- args.each do |path|
173
- path = File.expand_path(path)
174
- $:.unshift(path) if test(?d, path) and not $:.include?(path)
175
- end
176
- end
177
-
178
- # Find a rake task using the task name and remove any description text. This
179
- # will prevent the task from being displayed in the list of available tasks.
180
- #
181
- def remove_desc_for_task( names )
182
- Array(names).each do |task_name|
183
- task = Rake.application.tasks.find {|t| t.name == task_name}
184
- next if task.nil?
185
- task.instance_variable_set :@comment, nil
186
- end
187
- end
188
-
189
- # Change working directories to _dir_, call the _block_ of code, and then
190
- # change back to the original working directory (the current directory when
191
- # this method was called).
192
- #
193
- def in_directory( dir, &block )
194
- curdir = pwd
195
- begin
196
- cd dir
197
- return block.call
198
- ensure
199
- cd curdir
200
- end
201
- end
202
-
203
- # Scans the current working directory and creates a list of files that are
204
- # candidates to be in the manifest.
205
- #
206
- def manifest
207
- files = []
208
- exclude = PROJ.exclude.dup
209
- comment = %r/^\s*#/
210
- exclude << Regexp.escape(PROJ.ignore_file)
211
-
212
- # process the ignore file and add the items there to the exclude list
213
- if test(?f, PROJ.ignore_file)
214
- ary = []
215
- File.readlines(PROJ.ignore_file).each do |line|
216
- next if line =~ comment
217
- line.chomp!
218
- line.strip!
219
- next if line.nil? or line.empty?
220
-
221
- glob = line =~ %r/\*\./ ? File.join('**', line) : line
222
- Dir.glob(glob).each {|fn| ary << "^#{Regexp.escape(fn)}"}
223
- end
224
- exclude.concat ary
225
- end
226
-
227
- # generate a regular expression from the exclude list
228
- exclude = Regexp.new(exclude.join('|'))
229
-
230
- Find.find '.' do |path|
231
- path.sub! %r/^(\.\/|\/)/o, ''
232
- next unless test ?f, path
233
- next if path =~ exclude
234
- files << path
235
- end
236
- files.sort!
237
- end
238
-
239
- # We need a "valid" method thtat determines if a string is suitable for use
240
- # in the gem specification.
241
- #
242
- class Object
243
- def valid?
244
- return !(self.empty? or self == "\000") if self.respond_to?(:to_str)
245
- return false
246
- end
247
- end
248
-
249
- # EOF
data/tasks/test.rake DELETED
@@ -1,29 +0,0 @@
1
- require 'rake/testtask'
2
- if HAVE_RCOV
3
- require 'rcov/rcovtask'
4
- end
5
-
6
- namespace :test do
7
-
8
- Rake::TestTask.new(:run) do |t|
9
- t.libs = PROJ.libs
10
- t.test_files = if test(?f, PROJ.test.file) then [PROJ.test.file]
11
- else PROJ.test.files end
12
- t.ruby_opts += PROJ.ruby_opts
13
- t.ruby_opts += PROJ.test.opts
14
- end
15
-
16
- if HAVE_RCOV
17
- desc 'Run rcov on the unit tests'
18
- Rcov::RcovTask.new do |t|
19
- t.pattern = PROJ.rcov.pattern
20
- t.rcov_opts = PROJ.rcov.opts
21
- end
22
- end
23
-
24
- end # namespace :test
25
-
26
- desc 'Alias to test:run'
27
- task :test => 'test:run'
28
-
29
- task :clobber => 'test:clobber_rcov' if HAVE_RCOV