sudo-js-rails 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 74eb432b22031f8242cfb4ff35aa6f4519a612f1
4
+ data.tar.gz: 6a14c668a3ebc50f59eb8973ee7b885d04a2cd6d
5
+ SHA512:
6
+ metadata.gz: b36886b4c1cc064b9fa9e999ef8aba0ee50174874059d2fab4b14f2c4f0bca04aac5f73db568366c015aff85ccbcefc0e9814fccbdfc4983df00cee047fc1e49
7
+ data.tar.gz: fa4fc6af9b45ac14c385f4d2e12153ff4dabdb8bd26afb55aa7dcdc699455c4ab890b02bcf10b8991a6884121f35fabb29301125ee9f4ca72aef00d7c97a66cf
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in rails-gem.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 robrobbins
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # Rails::Gem
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'sudo-js-rails'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install sudo-js-rails
18
+
19
+ ## Usage
20
+
21
+ Reqiure the desired files from the sudo-js namespace in your JS manifests:
22
+
23
+ `//= require sudo-js/zepto`
24
+ `//= reqiure sudo-js/sudo`
25
+
26
+ If you are supporting legacy browsers, require the es5-shim and es5-sham
27
+
28
+ `//= require sudo-js/es5-shim`
29
+ `//= reqiure sudo-js/es5-sham`
30
+
31
+ ## Contributing
32
+
33
+ 1. Fork it
34
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
35
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
36
+ 4. Push to the branch (`git push origin my-new-feature`)
37
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+
8
+ require 'bundler/gem_tasks'
9
+
10
+ namespace :sudojs do
11
+ desc "Download the latest released versions sudo.js as well as Ecmascript-5 shims for non-standard browsers"
12
+ task :dl do
13
+ files = {
14
+ 'sudo.js'=>'https://raw.github.com/sudo-js/make-me-a-sandwich/master/build/debug/sudo.js',
15
+ 'es5-shim.js' => 'https://raw.github.com/sudo-js/make-me-a-sandwich/master/lib/es5-shim/es5-shim.js',
16
+ 'es5-sham.js' => 'https://raw.github.com/sudo-js/make-me-a-sandwich/master/lib/es5-shim/es5-sham.js',
17
+ 'zepto.js' => 'https://raw.github.com/sudo-js/zepto/sudo-js/dist/zepto.js'
18
+ }
19
+
20
+ vendor_dir = "vendor/assets/javascripts/sudo-js"
21
+
22
+ require 'open-uri'
23
+ files.each do |local,remote|
24
+ puts "Downloading #{local}"
25
+ File.open "#{vendor_dir}/#{local}", 'w' do |f|
26
+ f.write open(remote).read
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,5 @@
1
+ module Rails
2
+ module Gem
3
+ VERSION = "0.0.2"
4
+ end
5
+ end
data/lib/rails/gem.rb ADDED
@@ -0,0 +1,7 @@
1
+ require "rails/gem/version"
2
+
3
+ module Rails
4
+ module Gem
5
+ # Your code goes here...
6
+ end
7
+ end
data/rails-gem.gemspec ADDED
@@ -0,0 +1,23 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'rails/gem/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "sudo-js-rails"
8
+ spec.version = Rails::Gem::VERSION
9
+ spec.authors = ["robrobbins"]
10
+ spec.email = ["rob.robb.ns@gmail.com"]
11
+ spec.description = %q{Make sudojs, a custom Zepto build, es5-shim and es5-sham available to rails apps}
12
+ spec.summary = %q{That's about it}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", "~> 1.3"
22
+ spec.add_development_dependency "rake"
23
+ end
@@ -0,0 +1,25 @@
1
+ // Polyfills for non-std browsers that, while not attaining ES5 spec
2
+ // (hence `sham`), function correctly on a limited scope.
3
+ (function() {
4
+ if(!Object.create) {
5
+ Object.create = function(obj) {
6
+ var ret;
7
+ if (arguments.length > 1 ) {
8
+ // cannot support the multiple argument scenario for legacy browsers
9
+ throw new Error('This Object.create implementation only accepts a single argument');
10
+ }
11
+ function F(){}
12
+ F.prototype = obj;
13
+ ret = new F();
14
+ // Allows Object.getPrototypeOf to work in non-std browsers
15
+ ret.__proto__ = obj;
16
+ return ret;
17
+ };
18
+ }
19
+ // Will return the expected Object for all Objects created using the above `create` method
20
+ if(!Object.getPrototypeOf) {
21
+ Object.getPrototypeOf = function(object) {
22
+ return object.__proto__;
23
+ };
24
+ }
25
+ }());