Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit 3d1c9a1

Browse files
committed
Initial Rails 3.1 plugin template.
0 parents  commit 3d1c9a1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+743
-0
lines changed

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.bundle/
2+
log/*.log
3+
pkg/
4+
test/dummy/db/*.sqlite3
5+
test/dummy/log/*.log
6+
test/dummy/tmp/

Diff for: .rvmrc

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/usr/bin/env bash
2+
3+
# This is an RVM Project .rvmrc file, used to automatically load the ruby
4+
# development environment upon cd'ing into the directory
5+
6+
# First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
7+
environment_id="ruby-1.9.3-p0@requirejs-rails"
8+
9+
#
10+
# Uncomment following line if you want options to be set only for given project.
11+
#
12+
# PROJECT_JRUBY_OPTS=( --1.9 )
13+
14+
#
15+
# First we attempt to load the desired environment directly from the environment
16+
# file. This is very fast and efficient compared to running through the entire
17+
# CLI and selector. If you want feedback on which environment was used then
18+
# insert the word 'use' after --create as this triggers verbose mode.
19+
#
20+
if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
21+
&& -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
22+
then
23+
\. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
24+
25+
if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
26+
then
27+
. "${rvm_path:-$HOME/.rvm}/hooks/after_use"
28+
fi
29+
else
30+
# If the environment file has not yet been created, use the RVM CLI to select.
31+
if ! rvm --create use "$environment_id"
32+
then
33+
echo "Failed to create RVM environment '${environment_id}'."
34+
return 1
35+
fi
36+
fi
37+
38+
#
39+
# If you use an RVM gemset file to install a list of gems (*.gems), you can have
40+
# it be automatically loaded. Uncomment the following and adjust the filename if
41+
# necessary.
42+
#
43+
# filename=".gems"
44+
# if [[ -s "$filename" ]]
45+
# then
46+
# rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
47+
# fi
48+
49+
# If you use bundler, this might be useful to you:
50+
# if command -v bundle && [[ -s Gemfile ]]
51+
# then
52+
# bundle install
53+
# fi
54+
55+

Diff for: Gemfile

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
source "http://rubygems.org"
2+
3+
# Declare your gem's dependencies in requirejs-rails.gemspec.
4+
# Bundler will treat runtime dependencies like base dependencies, and
5+
# development dependencies will be added by default to the :development group.
6+
gemspec
7+
8+
# jquery-rails is used by the dummy application
9+
gem "jquery-rails"
10+
11+
# Declare any dependencies that are still in development here instead of in
12+
# your gemspec. These might include edge Rails or gems from your path or
13+
# Git. Remember to move these dependencies to your gemspec before releasing
14+
# your gem to rubygems.org.
15+
16+
# To use debugger
17+
# gem 'ruby-debug19', :require => 'ruby-debug'

Diff for: Gemfile.lock

+99
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
PATH
2+
remote: .
3+
specs:
4+
requirejs-rails (0.0.1)
5+
rails (~> 3.1.1)
6+
7+
GEM
8+
remote: http://rubygems.org/
9+
specs:
10+
actionmailer (3.1.1)
11+
actionpack (= 3.1.1)
12+
mail (~> 2.3.0)
13+
actionpack (3.1.1)
14+
activemodel (= 3.1.1)
15+
activesupport (= 3.1.1)
16+
builder (~> 3.0.0)
17+
erubis (~> 2.7.0)
18+
i18n (~> 0.6)
19+
rack (~> 1.3.2)
20+
rack-cache (~> 1.1)
21+
rack-mount (~> 0.8.2)
22+
rack-test (~> 0.6.1)
23+
sprockets (~> 2.0.2)
24+
activemodel (3.1.1)
25+
activesupport (= 3.1.1)
26+
builder (~> 3.0.0)
27+
i18n (~> 0.6)
28+
activerecord (3.1.1)
29+
activemodel (= 3.1.1)
30+
activesupport (= 3.1.1)
31+
arel (~> 2.2.1)
32+
tzinfo (~> 0.3.29)
33+
activeresource (3.1.1)
34+
activemodel (= 3.1.1)
35+
activesupport (= 3.1.1)
36+
activesupport (3.1.1)
37+
multi_json (~> 1.0)
38+
arel (2.2.1)
39+
builder (3.0.0)
40+
erubis (2.7.0)
41+
hike (1.2.1)
42+
i18n (0.6.0)
43+
jquery-rails (1.0.17)
44+
railties (~> 3.0)
45+
thor (~> 0.14)
46+
json (1.6.1)
47+
mail (2.3.0)
48+
i18n (>= 0.4.0)
49+
mime-types (~> 1.16)
50+
treetop (~> 1.4.8)
51+
mime-types (1.17.2)
52+
multi_json (1.0.3)
53+
polyglot (0.3.3)
54+
rack (1.3.5)
55+
rack-cache (1.1)
56+
rack (>= 0.4)
57+
rack-mount (0.8.3)
58+
rack (>= 1.0.0)
59+
rack-ssl (1.3.2)
60+
rack
61+
rack-test (0.6.1)
62+
rack (>= 1.0)
63+
rails (3.1.1)
64+
actionmailer (= 3.1.1)
65+
actionpack (= 3.1.1)
66+
activerecord (= 3.1.1)
67+
activeresource (= 3.1.1)
68+
activesupport (= 3.1.1)
69+
bundler (~> 1.0)
70+
railties (= 3.1.1)
71+
railties (3.1.1)
72+
actionpack (= 3.1.1)
73+
activesupport (= 3.1.1)
74+
rack-ssl (~> 1.3.2)
75+
rake (>= 0.8.7)
76+
rdoc (~> 3.4)
77+
thor (~> 0.14.6)
78+
rake (0.9.2.2)
79+
rdoc (3.11)
80+
json (~> 1.4)
81+
sprockets (2.0.3)
82+
hike (~> 1.2)
83+
rack (~> 1.0)
84+
tilt (~> 1.1, != 1.3.0)
85+
sqlite3 (1.3.4)
86+
thor (0.14.6)
87+
tilt (1.3.3)
88+
treetop (1.4.10)
89+
polyglot
90+
polyglot (>= 0.3.1)
91+
tzinfo (0.3.31)
92+
93+
PLATFORMS
94+
ruby
95+
96+
DEPENDENCIES
97+
jquery-rails
98+
requirejs-rails!
99+
sqlite3

Diff for: MIT-LICENSE

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Copyright 2011 YOURNAME
2+
3+
Permission is hereby granted, free of charge, to any person obtaining
4+
a copy of this software and associated documentation files (the
5+
"Software"), to deal in the Software without restriction, including
6+
without limitation the rights to use, copy, modify, merge, publish,
7+
distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to
9+
the following conditions:
10+
11+
The above copyright notice and this permission notice shall be
12+
included in all copies or substantial portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Diff for: README.rdoc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
= RequirejsRails
2+
3+
This project rocks and uses MIT-LICENSE.

Diff for: Rakefile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
begin
8+
require 'rdoc/task'
9+
rescue LoadError
10+
require 'rdoc/rdoc'
11+
require 'rake/rdoctask'
12+
RDoc::Task = Rake::RDocTask
13+
end
14+
15+
RDoc::Task.new(:rdoc) do |rdoc|
16+
rdoc.rdoc_dir = 'rdoc'
17+
rdoc.title = 'RequirejsRails'
18+
rdoc.options << '--line-numbers'
19+
rdoc.rdoc_files.include('README.rdoc')
20+
rdoc.rdoc_files.include('lib/**/*.rb')
21+
end
22+
23+
24+
25+
Bundler::GemHelper.install_tasks
26+
27+
require 'rake/testtask'
28+
29+
Rake::TestTask.new(:test) do |t|
30+
t.libs << 'lib'
31+
t.libs << 'test'
32+
t.pattern = 'test/**/*_test.rb'
33+
t.verbose = false
34+
end
35+
36+
37+
task :default => :test

Diff for: lib/requirejs-rails.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module RequirejsRails
2+
end

Diff for: lib/requirejs-rails/version.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module RequirejsRails
2+
VERSION = "0.0.1"
3+
end

Diff for: lib/tasks/requirejs-rails_tasks.rake

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# desc "Explaining what the task does"
2+
# task :requirejs-rails do
3+
# # Task goes here
4+
# end

Diff for: requirejs-rails.gemspec

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
$:.push File.expand_path("../lib", __FILE__)
2+
3+
# Maintain your gem's version:
4+
require "requirejs-rails/version"
5+
6+
# Describe your gem and declare its dependencies:
7+
Gem::Specification.new do |s|
8+
s.name = "requirejs-rails"
9+
s.version = RequirejsRails::VERSION
10+
s.authors = ["TODO: Your name"]
11+
s.email = ["TODO: Your email"]
12+
s.homepage = "TODO"
13+
s.summary = "TODO: Summary of RequirejsRails."
14+
s.description = "TODO: Description of RequirejsRails."
15+
16+
s.files = Dir["{app,config,db,lib}/**/*"] + ["MIT-LICENSE", "Rakefile", "README.rdoc"]
17+
s.test_files = Dir["test/**/*"]
18+
19+
s.add_dependency "rails", "~> 3.1.1"
20+
21+
s.add_development_dependency "sqlite3"
22+
end

Diff for: test/dummy/Rakefile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env rake
2+
# Add your own tasks in files placed in lib/tasks ending in .rake,
3+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4+
5+
require File.expand_path('../config/application', __FILE__)
6+
7+
Dummy::Application.load_tasks

Diff for: test/dummy/app/assets/javascripts/application.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// This is a manifest file that'll be compiled into including all the files listed below.
2+
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
3+
// be included in the compiled file accessible from http://example.com/assets/application.js
4+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
5+
// the compiled file.
6+
//
7+
//= require jquery
8+
//= require jquery_ujs
9+
//= require_tree .

Diff for: test/dummy/app/assets/stylesheets/application.css

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/*
2+
* This is a manifest file that'll automatically include all the stylesheets available in this directory
3+
* and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
4+
* the top of the compiled file, but it's generally better to create a new file per style scope.
5+
*= require_self
6+
*= require_tree .
7+
*/

Diff for: test/dummy/app/controllers/application_controller.rb

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class ApplicationController < ActionController::Base
2+
protect_from_forgery
3+
end

Diff for: test/dummy/app/helpers/application_helper.rb

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
module ApplicationHelper
2+
end

Diff for: test/dummy/app/mailers/.gitkeep

Whitespace-only changes.

Diff for: test/dummy/app/models/.gitkeep

Whitespace-only changes.

Diff for: test/dummy/app/views/layouts/application.html.erb

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Dummy</title>
5+
<%= stylesheet_link_tag "application" %>
6+
<%= javascript_include_tag "application" %>
7+
<%= csrf_meta_tags %>
8+
</head>
9+
<body>
10+
11+
<%= yield %>
12+
13+
</body>
14+
</html>

Diff for: test/dummy/config.ru

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This file is used by Rack-based servers to start the application.
2+
3+
require ::File.expand_path('../config/environment', __FILE__)
4+
run Dummy::Application

Diff for: test/dummy/config/application.rb

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
require File.expand_path('../boot', __FILE__)
2+
3+
require 'rails/all'
4+
5+
Bundler.require
6+
require "requirejs-rails"
7+
8+
module Dummy
9+
class Application < Rails::Application
10+
# Settings in config/environments/* take precedence over those specified here.
11+
# Application configuration should go into files in config/initializers
12+
# -- all .rb files in that directory are automatically loaded.
13+
14+
# Custom directories with classes and modules you want to be autoloadable.
15+
# config.autoload_paths += %W(#{config.root}/extras)
16+
17+
# Only load the plugins named here, in the order given (default is alphabetical).
18+
# :all can be used as a placeholder for all plugins not explicitly named.
19+
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20+
21+
# Activate observers that should always be running.
22+
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23+
24+
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25+
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26+
# config.time_zone = 'Central Time (US & Canada)'
27+
28+
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29+
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30+
# config.i18n.default_locale = :de
31+
32+
# Configure the default encoding used in templates for Ruby 1.9.
33+
config.encoding = "utf-8"
34+
35+
# Configure sensitive parameters which will be filtered from the log file.
36+
config.filter_parameters += [:password]
37+
38+
# Enable the asset pipeline
39+
config.assets.enabled = true
40+
41+
# Version of your assets, change this if you want to expire all your assets
42+
config.assets.version = '1.0'
43+
end
44+
end
45+

Diff for: test/dummy/config/boot.rb

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
require 'rubygems'
2+
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3+
4+
if File.exist?(gemfile)
5+
ENV['BUNDLE_GEMFILE'] = gemfile
6+
require 'bundler'
7+
Bundler.setup
8+
end
9+
10+
$:.unshift File.expand_path('../../../../lib', __FILE__)

0 commit comments

Comments
 (0)