easel_helpers_lite 0.1.2
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/.document +5 -0
- data/.gitignore +21 -0
- data/README.rdoc +17 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/easel_helpers_lite.gemspec +48 -0
- data/lib/easel_helpers_lite.rb +1 -0
- data/lib/easel_helpers_lite/helpers.rb +39 -0
- data/lib/easel_helpers_lite/railtie.rb +15 -0
- metadata +90 -0
data/.document
ADDED
data/.gitignore
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
= Easel Lite
|
2
|
+
|
3
|
+
Rails 3 compatible helpers for the Easel framework without the fat.
|
4
|
+
|
5
|
+
== Note on Patches/Pull Requests
|
6
|
+
|
7
|
+
* Fork the project.
|
8
|
+
* Make your feature addition or bug fix.
|
9
|
+
* Add tests for it. This is important so I don't break it in a
|
10
|
+
future version unintentionally.
|
11
|
+
* Commit, do not mess with rakefile, version, or history.
|
12
|
+
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
13
|
+
* Send me a pull request. Bonus points for topic branches.
|
14
|
+
|
15
|
+
== Copyright
|
16
|
+
|
17
|
+
Copyright (c) 2010 Fusionary Media.
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
|
4
|
+
begin
|
5
|
+
require 'jeweler'
|
6
|
+
Jeweler::Tasks.new do |gem|
|
7
|
+
gem.name = "easel_helpers_lite"
|
8
|
+
gem.summary = "Lightweight helper library that makes using easel with Rails a snap"
|
9
|
+
gem.description = "Lightweight helper library that makes using easel with Rails a snap"
|
10
|
+
gem.email = "jstewart@fusionary.com"
|
11
|
+
gem.homepage = "https://github.com/fusionary/Easel-Helpers-Lite"
|
12
|
+
gem.authors = ["Jason Stewart"]
|
13
|
+
gem.add_dependency 'nokogiri', '>=1.4.1'
|
14
|
+
end
|
15
|
+
Jeweler::GemcutterTasks.new
|
16
|
+
rescue LoadError
|
17
|
+
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
18
|
+
end
|
19
|
+
|
20
|
+
require 'rake/testtask'
|
21
|
+
Rake::TestTask.new(:test) do |test|
|
22
|
+
test.libs << 'lib' << 'test'
|
23
|
+
test.pattern = 'test/**/test_*.rb'
|
24
|
+
test.verbose = true
|
25
|
+
end
|
26
|
+
|
27
|
+
begin
|
28
|
+
require 'rcov/rcovtask'
|
29
|
+
Rcov::RcovTask.new do |test|
|
30
|
+
test.libs << 'test'
|
31
|
+
test.pattern = 'test/**/test_*.rb'
|
32
|
+
test.verbose = true
|
33
|
+
end
|
34
|
+
rescue LoadError
|
35
|
+
task :rcov do
|
36
|
+
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
task :test => :check_dependencies
|
41
|
+
|
42
|
+
task :default => :test
|
43
|
+
|
44
|
+
require 'rake/rdoctask'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "easel_lite #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.2
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{easel_helpers_lite}
|
8
|
+
s.version = "0.1.2"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Jason Stewart"]
|
12
|
+
s.date = %q{2010-11-08}
|
13
|
+
s.description = %q{Lightweight helper library that makes using easel with Rails a snap}
|
14
|
+
s.email = %q{jstewart@fusionary.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"README.rdoc"
|
17
|
+
]
|
18
|
+
s.files = [
|
19
|
+
".document",
|
20
|
+
".gitignore",
|
21
|
+
"README.rdoc",
|
22
|
+
"Rakefile",
|
23
|
+
"VERSION",
|
24
|
+
"easel_helpers_lite.gemspec",
|
25
|
+
"lib/easel_helpers_lite.rb",
|
26
|
+
"lib/easel_helpers_lite/helpers.rb",
|
27
|
+
"lib/easel_helpers_lite/railtie.rb"
|
28
|
+
]
|
29
|
+
s.homepage = %q{https://github.com/fusionary/Easel-Helpers-Lite}
|
30
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
31
|
+
s.require_paths = ["lib"]
|
32
|
+
s.rubygems_version = %q{1.3.7}
|
33
|
+
s.summary = %q{Lightweight helper library that makes using easel with Rails a snap}
|
34
|
+
|
35
|
+
if s.respond_to? :specification_version then
|
36
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
37
|
+
s.specification_version = 3
|
38
|
+
|
39
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
40
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.1"])
|
41
|
+
else
|
42
|
+
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
43
|
+
end
|
44
|
+
else
|
45
|
+
s.add_dependency(%q<nokogiri>, [">= 1.4.1"])
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'easel_helpers_lite/railtie'
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module EaselHelpersLite
|
2
|
+
module Helpers
|
3
|
+
def body(*args)
|
4
|
+
@_classes ||= []
|
5
|
+
@_classes += args.select(&:present?).map do |arg|
|
6
|
+
arg.to_s.strip
|
7
|
+
end.uniq
|
8
|
+
|
9
|
+
if block_given?
|
10
|
+
attributes = {}
|
11
|
+
attributes[:class] = @_classes.join(" ") if @_classes.length > 0
|
12
|
+
content_tag(:body, capture {yield}, attributes)
|
13
|
+
else
|
14
|
+
nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def link_button(*args, &block)
|
19
|
+
doc = Nokogiri(link_to(*args, &block))
|
20
|
+
doc.at("a").inner_html = "<span>#{doc.at("a").inner_html}</span>"
|
21
|
+
(doc/:a).add_class("btn")
|
22
|
+
raw(doc.to_html)
|
23
|
+
end
|
24
|
+
|
25
|
+
def submit_button(*args, &block)
|
26
|
+
button_text = args.first
|
27
|
+
options = args.extract_options!
|
28
|
+
klass = options[:class] || "btn"
|
29
|
+
|
30
|
+
content_tag("button", :type => "submit", :class => klass) do
|
31
|
+
if block_given?
|
32
|
+
yield
|
33
|
+
else
|
34
|
+
content_tag("span", button_text)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'active_support'
|
2
|
+
require 'action_view'
|
3
|
+
require 'easel_helpers_lite/helpers'
|
4
|
+
|
5
|
+
module EaselHelpersLite
|
6
|
+
class Railtie < Rails::Railtie
|
7
|
+
railtie_name :easel_helpers_lite
|
8
|
+
|
9
|
+
initializer :insert_into_action_view do
|
10
|
+
ActiveSupport.on_load(:action_view) do
|
11
|
+
ActionView::Base.send(:include, EaselHelpersLite::Helpers)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: easel_helpers_lite
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Jason Stewart
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-11-08 00:00:00 -05:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: nokogiri
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 5
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 4
|
33
|
+
- 1
|
34
|
+
version: 1.4.1
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
description: Lightweight helper library that makes using easel with Rails a snap
|
38
|
+
email: jstewart@fusionary.com
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files:
|
44
|
+
- README.rdoc
|
45
|
+
files:
|
46
|
+
- .document
|
47
|
+
- .gitignore
|
48
|
+
- README.rdoc
|
49
|
+
- Rakefile
|
50
|
+
- VERSION
|
51
|
+
- easel_helpers_lite.gemspec
|
52
|
+
- lib/easel_helpers_lite.rb
|
53
|
+
- lib/easel_helpers_lite/helpers.rb
|
54
|
+
- lib/easel_helpers_lite/railtie.rb
|
55
|
+
has_rdoc: true
|
56
|
+
homepage: https://github.com/fusionary/Easel-Helpers-Lite
|
57
|
+
licenses: []
|
58
|
+
|
59
|
+
post_install_message:
|
60
|
+
rdoc_options:
|
61
|
+
- --charset=UTF-8
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ">="
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
hash: 3
|
70
|
+
segments:
|
71
|
+
- 0
|
72
|
+
version: "0"
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
none: false
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
hash: 3
|
79
|
+
segments:
|
80
|
+
- 0
|
81
|
+
version: "0"
|
82
|
+
requirements: []
|
83
|
+
|
84
|
+
rubyforge_project:
|
85
|
+
rubygems_version: 1.3.7
|
86
|
+
signing_key:
|
87
|
+
specification_version: 3
|
88
|
+
summary: Lightweight helper library that makes using easel with Rails a snap
|
89
|
+
test_files: []
|
90
|
+
|