jquery-lotus 0.0.1

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5b65bd8cf4d72ac29c96dcc5fc22d6e7886fd497
4
+ data.tar.gz: e3253a594c853aeae76e3efdd559298277040771
5
+ SHA512:
6
+ metadata.gz: a6e2aca88277904e750619614f3e321a5be867764d61448c4cec0950fc84111d2f8c8e29564323f45c6b01581a796767e7a702d5852c8c89ecd08947888d8802
7
+ data.tar.gz: d5865934957ee1a607eeca393eaf99bd940984a09d53b21418dd366b20b401d841c7ebc4a312882f578a040c368e06c1a54e54366aa8774b643f5459e9f096cd
data/.gitignore ADDED
@@ -0,0 +1,8 @@
1
+ pkg/*
2
+ tmp
3
+ spec/support/*/Gemfile.lock
4
+ spec/support/*/public/javascripts
5
+ .ruby-version
6
+ .bundle
7
+ imports/*
8
+ Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
data/MIT-LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2010-2015 Gonzalo Rodríguez-Baltanás Díaz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,31 @@
1
+ # jquery-lotus
2
+
3
+ Jquery for Lotus.
4
+
5
+ This gem provides:
6
+
7
+ * jQuery 1 and jQuery 2
8
+ * the jQuery UJS adapter
9
+
10
+ ## Installation
11
+
12
+ Add to Gemfile.
13
+ ```
14
+ gem 'jquery-lotus'
15
+ ```
16
+
17
+ Add to our tenmplate:
18
+ ```
19
+ <%= javascript 'jquery' %>
20
+
21
+ or
22
+
23
+ <%= javascript 'jquery2' %>
24
+
25
+ optionally:
26
+ <%= javascript 'jquery_ujs' %>
27
+ ```
28
+
29
+ ## License
30
+
31
+ jquery-lotus is released under the [MIT License](MIT-LICENSE).
data/Rakefile ADDED
@@ -0,0 +1,48 @@
1
+ require 'bundler'
2
+ require 'rake/testtask'
3
+ Bundler::GemHelper.install_tasks
4
+
5
+ # Check if versions are correct between VERSION constants and .js files
6
+ #
7
+ task :release => [:guard_version]
8
+
9
+ task :guard_version do
10
+ def check_version(file, pattern, constant)
11
+ body = File.read("vendor/assets/javascripts/#{file}")
12
+ match = body.match(pattern) or abort "Version check failed: no pattern matched in #{file}"
13
+ file_version = match[1]
14
+ constant_version = Jquery::Lotus.const_get(constant)
15
+
16
+ unless constant_version == file_version
17
+ abort "Jquery::Lotus::#{constant} was #{constant_version} but it should be #{file_version}"
18
+ end
19
+ end
20
+
21
+ check_version('jquery.js', /jQuery JavaScript Library v([\S]+)/, 'JQUERY_VERSION')
22
+ check_version('jquery2.js', /jQuery JavaScript Library v([\S]+)/, 'JQUERY_2_VERSION')
23
+ end
24
+
25
+ desc "Update jQuery versions"
26
+ task :update_jquery do
27
+ def download_jquery(filename, version)
28
+ suffix = "-#{version}"
29
+
30
+ puts "Downloading #{filename}.js"
31
+ puts `curl -o vendor/assets/javascripts/#{filename}.js http://code.jquery.com/jquery#{suffix}.js`
32
+ puts "Downloading #{filename}.min.js"
33
+ puts `curl -o vendor/assets/javascripts/#{filename}.min.js http://code.jquery.com/jquery#{suffix}.min.js`
34
+ puts "Downloading #{filename}.min.map"
35
+ puts `curl -o vendor/assets/javascripts/#{filename}.min.map http://code.jquery.com/jquery#{suffix}.min.map`
36
+ end
37
+
38
+ download_jquery('jquery', Jquery::Lotus::JQUERY_VERSION)
39
+ download_jquery('jquery2', Jquery::Lotus::JQUERY_2_VERSION)
40
+ puts "\e[32mDone!\e[0m"
41
+ end
42
+
43
+ desc "Update jQuery UJS version"
44
+ task :update_jquery_ujs do
45
+ puts "Downloading jquery_ujs.js"
46
+ puts `curl -o vendor/assets/javascripts/jquery_ujs.js https://raw.githubusercontent.com/rails/jquery-ujs/v#{Jquery::Lotus::JQUERY_UJS_VERSION}/src/rails.js`
47
+ puts "\e[32mDone!\e[0m"
48
+ end
@@ -0,0 +1,23 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/jquery/version', __FILE__)
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = "jquery-lotus"
6
+ s.version = Jquery::Lotus::VERSION
7
+ s.platform = Gem::Platform::RUBY
8
+ s.authors = ["Gonzalo Rodríguez-Baltanás Díaz"]
9
+ s.email = ["siotopo@gmail.com"]
10
+ s.homepage = "http://rubygems.org/gems/jquery-lotus"
11
+ s.summary = "jQuery for Lotus"
12
+ s.description = "This gem provides jQuery and the jQuery-ujs driver for your Lotus application."
13
+ s.license = "MIT"
14
+
15
+ s.required_ruby_version = ">= 1.9.3"
16
+ s.required_rubygems_version = ">= 1.3.6"
17
+
18
+ s.add_dependency "lotus-assets"
19
+
20
+ s.files = `git ls-files`.split("\n")
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
22
+ s.require_path = 'lib'
23
+ end
@@ -0,0 +1,8 @@
1
+ module Jquery
2
+ module Lotus
3
+ VERSION = "0.0.1"
4
+ JQUERY_VERSION = "1.11.3"
5
+ JQUERY_2_VERSION = "2.1.4"
6
+ JQUERY_UJS_VERSION = "1.1.0"
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ require 'jquery/version'
2
+
3
+ module Jquery
4
+ module Lotus
5
+ class << self
6
+ def load!
7
+ ::Lotus::Assets.sources << assets_path
8
+ end
9
+
10
+ def gem_path
11
+ @gem_path ||= File.expand_path '..', File.dirname(__FILE__)
12
+ end
13
+
14
+ def assets_path
15
+ @assets_path ||= File.join gem_path, 'vendor', 'assets'
16
+ end
17
+ end
18
+ end
19
+ end
20
+
21
+ Jquery::Lotus.load!