formtastic_jquids 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,3 @@
1
+ pkg/*
2
+ *.gem
3
+ *.swp
data/MIT-LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ Copyright (C) 2011 by David Oshiro and Nicholas LaMuro
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,47 @@
1
+ FormtasticJquids
2
+ ================
3
+
4
+ Based off of David Oshiro's FormtasticCalendarDateSelect
5
+ (https://github.com/dyohi/formtastic_calendar_date_select), this gem is ment to
6
+ add the jquids (https://github.com/NickLaMuro/jquids) jQueryUI datepicker to
7
+ the formtastic framework.
8
+
9
+
10
+ Installation
11
+ ------------
12
+
13
+ ###1. Install the gem
14
+
15
+ $ gem install formtastic_jquids
16
+
17
+ ###2. Add it to your application
18
+
19
+ This gem assumes that you have both the formtastic and jquids gems installed.
20
+
21
+ ####Rails 2:
22
+
23
+ In config/environment.rb:
24
+
25
+ config.gem "formtastic"
26
+ config.gem "jquids"
27
+ config.gem "formtastic_jquids"
28
+
29
+ ####Rails 3:
30
+
31
+ In your Gemfile:
32
+
33
+ gem "formtastic"
34
+ gem "jquids"
35
+ gem "formtastic_jquids"
36
+
37
+
38
+ Usage
39
+ -----
40
+
41
+ Where ever there is a field that needs to have a jquids datepicker, just a `:as => :jquids`:
42
+
43
+ <% semantic_form_for @task do |form| %>
44
+ <% form.inputs do %>
45
+ <%= form.input :due_date, :as => :calendardateselect %>
46
+ <% end %>
47
+ <% end %>
data/Rakefile ADDED
@@ -0,0 +1,24 @@
1
+ require "rubygems"
2
+ require "rake"
3
+
4
+ gemspec = eval(File.read(Dir["*.gemspec"].first))
5
+
6
+ desc "Validate the gemspec"
7
+ task :gemspec do
8
+ puts "Validating the gem..."
9
+ gemspec.validate
10
+ end
11
+
12
+ desc "Build gem locally"
13
+ task :build => :gemspec do
14
+ puts "Building the gem..."
15
+ system "gem build #{gemspec.name}.gemspec"
16
+ FileUtils.mkdir_p "pkg"
17
+ FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
18
+ end
19
+
20
+ desc "Install gem locally"
21
+ task :install => :build do
22
+ puts "Installing..."
23
+ system "gem install pkg/#{gemspec.name}-#{gemspec.version}"
24
+ end
@@ -0,0 +1,18 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+ require "version"
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "formtastic_jquids"
6
+ s.version = FormtasticJquids::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.summary = "This is small gem for adding jQuery calendars from the jquids gem to the formtastic framework."
9
+ s.description = "Formtastic plugin for the jquids gem"
10
+ s.authors = "Nick LaMuro"
11
+ s.email = "nicklamuro@gmail.com"
12
+ s.homepage = "https://github.com/NickLaMuro/formtastic_jquids"
13
+
14
+ s.files = `git ls-files`.split("\n")
15
+ s.test_files = `git ls-files -- {spec}/*`.split("\n")
16
+ s.require_paths = ["lib"]
17
+ end
18
+
data/init.rb ADDED
@@ -0,0 +1 @@
1
+ require File.join(File.dirname(__FILE__), *%w{lib formtastic_jquids})
@@ -0,0 +1,16 @@
1
+ module JquidsInputs
2
+ module Formtastic
3
+ module Jquids
4
+
5
+ protected
6
+
7
+ def jquids_input(method, options = {})
8
+ self.label(method, options_for_label(options)) +
9
+ self.jquids(method, strip_formtastic_options(options))
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+
16
+ Formtastic::SemanticFormBuilder.send(:include, JquidsInputs::Formtastic::Jquids)
data/lib/version.rb ADDED
@@ -0,0 +1,3 @@
1
+ module FormtasticJquids
2
+ VERSION = "0.1.1"
3
+ end
data/rails/init.rb ADDED
@@ -0,0 +1 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), "..", "init"))
metadata ADDED
@@ -0,0 +1,75 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: formtastic_jquids
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 1
10
+ version: 0.1.1
11
+ platform: ruby
12
+ authors:
13
+ - Nick LaMuro
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-07-12 00:00:00 -05:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: Formtastic plugin for the jquids gem
23
+ email: nicklamuro@gmail.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - .gitignore
32
+ - MIT-LICENSE
33
+ - README.md
34
+ - Rakefile
35
+ - formtastic_jquids.gemspec
36
+ - init.rb
37
+ - lib/formtastic_jquids.rb
38
+ - lib/version.rb
39
+ - rails/init.rb
40
+ has_rdoc: true
41
+ homepage: https://github.com/NickLaMuro/formtastic_jquids
42
+ licenses: []
43
+
44
+ post_install_message:
45
+ rdoc_options: []
46
+
47
+ require_paths:
48
+ - lib
49
+ required_ruby_version: !ruby/object:Gem::Requirement
50
+ none: false
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ hash: 3
55
+ segments:
56
+ - 0
57
+ version: "0"
58
+ required_rubygems_version: !ruby/object:Gem::Requirement
59
+ none: false
60
+ requirements:
61
+ - - ">="
62
+ - !ruby/object:Gem::Version
63
+ hash: 3
64
+ segments:
65
+ - 0
66
+ version: "0"
67
+ requirements: []
68
+
69
+ rubyforge_project:
70
+ rubygems_version: 1.3.7
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: This is small gem for adding jQuery calendars from the jquids gem to the formtastic framework.
74
+ test_files: []
75
+