-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
emulate implementation from jquery-rails gem
- Loading branch information
Showing
18 changed files
with
121 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
source 'http://rubygems.org' | ||
|
||
gem 'sinatra', '~> 1.0' | ||
gem 'shotgun', :group => :reloadable | ||
gem 'thin', :group => :reloadable | ||
gem 'json' | ||
# Specify your gem's dependencies in jquery-rails.gemspec | ||
gemspec | ||
# Rails is already being pulled in through gemspec | ||
# gem "rails", :git => "git://github.com/rails/rails.git" | ||
gem "rack", :git => "git://github.com/rack/rack.git" | ||
gem "sprockets", :git => "git://github.com/sstephenson/sprockets.git" | ||
gem "i18n", "0.6.0beta1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
GEM | ||
remote: http://rubygems.org/ | ||
specs: | ||
daemons (1.1.3) | ||
eventmachine (0.12.10) | ||
json (1.5.2) | ||
rack (1.3.0) | ||
shotgun (0.9) | ||
rack (>= 1.0) | ||
sinatra (1.2.6) | ||
rack (~> 1.1) | ||
tilt (< 2.0, >= 1.2.2) | ||
thin (1.2.11) | ||
daemons (>= 1.0.9) | ||
eventmachine (>= 0.12.6) | ||
rack (>= 1.0.0) | ||
tilt (1.3.2) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
json | ||
shotgun | ||
sinatra (~> 1.0) | ||
thin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'bundler' | ||
Bundler::GemHelper.install_tasks | ||
|
||
# require "spec/rake/spectask" | ||
# desc "Run all examples" | ||
# Spec::Rake::SpecTask.new(:spec) do |t| | ||
# t.ruby_opts = ['-r test/unit'] | ||
# t.spec_opts = %w[--color] | ||
# end | ||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'rails' | ||
|
||
module Jquery | ||
module Generators | ||
class InstallGenerator < ::Rails::Generators::Base | ||
|
||
desc "This generator installs Spine #{Spine::Rails::SPINE_VERSION}" | ||
|
||
source_root File.expand_path('../../../../../vendor/assets/javascripts', __FILE__) | ||
|
||
def copy_spine | ||
say_status("copying", "Spine (#{Spine::Rails::SPINE_VERSION})", :green) | ||
copy_file "spine.js", "public/javascripts/spine.js" | ||
copy_file "spine.min.js", "public/javascripts/spine.min.js" | ||
end | ||
end | ||
end | ||
end if ::Rails.version < "3.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require 'jquery/rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module Jquery | ||
module Rails | ||
PROTOTYPE_JS = %w{prototype effects dragdrop controls} | ||
|
||
if ::Rails.version < "3.1" | ||
require 'jquery/rails/railtie' | ||
else | ||
require 'jquery/rails/engine' | ||
end | ||
require 'jquery/rails/version' | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module Jquery | ||
module Rails | ||
class Railtie < ::Rails::Railtie | ||
config.before_configuration do | ||
if ::Rails.root.join("public/javascripts/spine.min.js").exist? | ||
sp_defaults = %w(spine) | ||
sp_defaults.map! {|a| a + ".min" } if ::Rails.env.production? | ||
else | ||
sp_defaults = ::Rails.env.production? ? %w(spine.min) : %w(spine) | ||
end | ||
|
||
config.action_view.javascript_expansions[:defaults] |= sp_defaults | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module Jquery | ||
module Rails | ||
VERSION = "0.0.1" | ||
SPINE_VERSION = "0.0.4" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- encoding: utf-8 -*- | ||
require File.expand_path('../lib/jquery/rails/version', __FILE__) | ||
|
||
Gem::Specification.new do |s| | ||
s.name = "jquery-rails" | ||
s.version = Jquery::Rails::VERSION | ||
s.platform = Gem::Platform::RUBY | ||
s.authors = ["André Arko"] | ||
s.email = ["andre@arko.net"] | ||
s.homepage = "http://rubygems.org/gems/jquery-rails" | ||
s.summary = "Use jQuery with Rails 3" | ||
s.description = "This gem provides jQuery and the jQuery-ujs driver for your Rails 3 application." | ||
|
||
s.required_rubygems_version = ">= 1.3.6" | ||
s.rubyforge_project = "jquery-rails" | ||
|
||
s.add_dependency "railties", "~> 3.0" | ||
s.add_dependency "thor", "~> 0.14" | ||
s.add_development_dependency "bundler", "~> 1.0.0" | ||
s.add_development_dependency "rails", "~> 3.0" | ||
|
||
s.files = `git ls-files`.split("\n") | ||
s.executables = `git ls-files`.split("\n").select{|f| f =~ /^bin/} | ||
s.require_path = 'lib' | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.