merb_helpers 0.4.0 → 0.5
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.
- data/README +36 -1
- data/Rakefile +40 -6
- data/lib/merb_helpers/date_time_helpers.rb +7 -0
- data/lib/merb_helpers/form_helpers.rb +596 -0
- data/lib/{form_model.rb → merb_helpers/form_model.rb} +0 -0
- data/lib/merb_helpers.rb +33 -10
- data/lib/{merb_helpers/merbtasks.rb → tasks/merb_tasks.rb} +0 -0
- metadata +11 -11
- data/lib/form_helpers.rb +0 -183
- data/specs/merb_helpers_spec.rb +0 -412
- data/specs/spec_helper.rb +0 -99
data/README
CHANGED
@@ -1,4 +1,39 @@
|
|
1
1
|
merb_helpers
|
2
2
|
=================
|
3
3
|
|
4
|
-
A plugin for the Merb framework that provides
|
4
|
+
A plugin for the Merb Web framework that provides different view helpers.
|
5
|
+
|
6
|
+
To use this plugin in merb in your app
|
7
|
+
|
8
|
+
config/dependencies.rb
|
9
|
+
|
10
|
+
#...
|
11
|
+
|
12
|
+
dependency "merb_helpers"
|
13
|
+
|
14
|
+
#...
|
15
|
+
|
16
|
+
By default all modules of merb_helpers are loaded and are available to your merb app.
|
17
|
+
|
18
|
+
You can selectively include/exclude modules from this list to keep you app lean if you like.
|
19
|
+
The inclusions/exclusions are relative to all modules.
|
20
|
+
|
21
|
+
\:include: will only include the specified modules.
|
22
|
+
|
23
|
+
\:exclude: will include all except the specified modules.
|
24
|
+
|
25
|
+
Do not use :include: and :exclude: options at the same time or an error will be raised.
|
26
|
+
|
27
|
+
To set this up in config/plugins.yml
|
28
|
+
|
29
|
+
To Include specified helpers
|
30
|
+
|
31
|
+
\:merb_helpers:
|
32
|
+
\:include: - date_time_helpers
|
33
|
+
- form_helpers
|
34
|
+
|
35
|
+
To Exclude specified helpers
|
36
|
+
|
37
|
+
\:merb_helpers:
|
38
|
+
\:exclude: - date_time_helpers
|
39
|
+
- form_helpers
|
data/Rakefile
CHANGED
@@ -1,17 +1,23 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rake/gempackagetask'
|
3
|
+
require 'rake/rdoctask'
|
4
|
+
require 'spec/rake/spectask'
|
3
5
|
|
4
6
|
PLUGIN = "merb_helpers"
|
5
7
|
NAME = "merb_helpers"
|
6
|
-
|
8
|
+
GEM_VERSION = "0.5"
|
7
9
|
AUTHOR = "Yehuda Katz"
|
8
10
|
EMAIL = "wycats@gmail.com"
|
9
11
|
HOMEPAGE = "http://merb.rubyforge.org/"
|
10
12
|
SUMMARY = "Helper support for merb (similar to the Rails form helpers)"
|
11
13
|
|
14
|
+
windows = (PLATFORM =~ /win32|cygwin/)
|
15
|
+
|
16
|
+
SUDO = windows ? "" : "sudo"
|
17
|
+
|
12
18
|
spec = Gem::Specification.new do |s|
|
13
19
|
s.name = NAME
|
14
|
-
s.version =
|
20
|
+
s.version = GEM_VERSION
|
15
21
|
s.platform = Gem::Platform::RUBY
|
16
22
|
s.has_rdoc = true
|
17
23
|
s.extra_rdoc_files = ["README", "LICENSE", 'TODO']
|
@@ -20,18 +26,46 @@ spec = Gem::Specification.new do |s|
|
|
20
26
|
s.author = AUTHOR
|
21
27
|
s.email = EMAIL
|
22
28
|
s.homepage = HOMEPAGE
|
23
|
-
s.
|
29
|
+
s.add_dependency("merb", ">=0.5")
|
24
30
|
s.require_path = 'lib'
|
25
31
|
s.autorequire = PLUGIN
|
26
32
|
s.files = %w(LICENSE README Rakefile TODO) + Dir.glob("{lib,specs}/**/*")
|
27
33
|
end
|
28
34
|
|
29
|
-
spec.add_dependency("merb", ">=0.4")
|
30
35
|
|
31
36
|
Rake::GemPackageTask.new(spec) do |pkg|
|
32
37
|
pkg.gem_spec = spec
|
33
38
|
end
|
34
39
|
|
40
|
+
desc "Run :package and install resulting .gem"
|
35
41
|
task :install => [:package] do
|
36
|
-
sh %{
|
37
|
-
end
|
42
|
+
sh %{#{SUDO} gem install pkg/#{NAME}-#{GEM_VERSION} --no-rdoc --no-ri}
|
43
|
+
end
|
44
|
+
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
files = ['README', 'LICENSE',
|
47
|
+
'lib/**/*.rb']
|
48
|
+
rdoc.rdoc_files.add(files)
|
49
|
+
rdoc.main = 'README'
|
50
|
+
rdoc.title = 'Merb Helper Docs'
|
51
|
+
rdoc.rdoc_dir = 'doc/rdoc'
|
52
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
53
|
+
end
|
54
|
+
|
55
|
+
|
56
|
+
Spec::Rake::SpecTask.new do |t|
|
57
|
+
t.warning = true
|
58
|
+
t.spec_opts = ["--format", "specdoc", "--colour"]
|
59
|
+
t.spec_files = Dir['spec/**/*_spec.rb'].sort
|
60
|
+
end
|
61
|
+
|
62
|
+
desc "Run all specs and generate an rcov report"
|
63
|
+
Spec::Rake::SpecTask.new('rcov') do |t|
|
64
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
65
|
+
t.spec_opts = ["--format", "specdoc", "--colour"]
|
66
|
+
t.rcov = true
|
67
|
+
t.rcov_dir = 'coverage'
|
68
|
+
t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
|
69
|
+
end
|
70
|
+
|
71
|
+
|