Permalink
Browse files

Merge branch 'sinatra' of github.com:winton/gem_template

Conflicts:
	lib/a_b_front_end.rb
	lib/a_b_front_end/boot/console.rb
	require.rb
	script/console
	spec/spec_helper.rb
  • Loading branch information...
winton committed Jul 13, 2010
2 parents 89b5857 + a35b577 commit 6fa9538e3931790e8d84a4ba2f68e8b1e97f19a3
Showing with 598 additions and 240 deletions.
  1. +0 −1 .gitignore
  2. +57 −0 Gemfile
  3. +103 −0 Gemfile.lock
  4. +2 −2 MIT-LICENSE → LICENSE
  5. +2 −2 README.markdown → README.md
  6. +39 −21 Rakefile
  7. +30 −0 a_b_front_end.gemspec
  8. +1 −1 config.ru
  9. +1 −1 config/a_b.yml
  10. +1 −1 config/database.example.yml
  11. +1 −1 config/externals.yml
  12. +1 −1 config/mail.example.yml
  13. +1 −1 db/migrate/001_users.rb
  14. +1 −1 features/example.feature
  15. +1 −1 features/support/env.rb
  16. +1 −1 features/support/rspec.rb
  17. +1 −1 features/support/webrat.rb
  18. +18 −2 lib/a_b_front_end.rb
  19. +1 −1 lib/a_b_front_end/boot/active_wrapper.rb
  20. +1 −1 lib/a_b_front_end/boot/application.rb
  21. +9 −2 lib/a_b_front_end/boot/console.rb
  22. +1 −1 lib/a_b_front_end/boot/controller.rb
  23. +1 −1 lib/a_b_front_end/boot/flash.rb
  24. +1 −1 lib/a_b_front_end/boot/helper.rb
  25. +1 −3 lib/a_b_front_end/boot/lilypad.rb
  26. +1 −1 lib/a_b_front_end/boot/model.rb
  27. +1 −1 lib/a_b_front_end/boot/session.rb
  28. +1 −1 lib/a_b_front_end/boot/sinatra.rb
  29. +1 −1 lib/a_b_front_end/controller/api.rb
  30. +1 −1 lib/a_b_front_end/controller/front.rb
  31. +1 −1 lib/a_b_front_end/helper/application.rb
  32. +1 −1 lib/a_b_front_end/model/user.rb
  33. +3 −0 lib/a_b_front_end/version.rb
  34. +1 −1 lib/a_b_front_end/view/layout.haml
  35. +1 −1 lib/a_b_front_end/view/spec.haml
  36. +1 −1 public/css/blueprint/ie.css
  37. +1 −1 public/css/blueprint/print.css
  38. +1 −1 public/css/blueprint/screen.css
  39. +1 −1 public/css/qunit.css
  40. +1 −1 public/js/jquery.js
  41. +1 −1 public/js/qunit.js
  42. +0 −84 require.rb
  43. +5 −1 script/console
  44. +4 −0 spec/a_b_front_end_spec.rb
  45. +16 −2 spec/spec_helper.rb
  46. +0 −1 vendor/a_b_plugin/.gitignore
  47. +41 −0 vendor/a_b_plugin/Gemfile
  48. +74 −0 vendor/a_b_plugin/Gemfile.lock
  49. +2 −2 vendor/a_b_plugin/{MIT-LICENSE → LICENSE}
  50. 0 vendor/a_b_plugin/{README.markdown → README.md}
  51. +68 −2 vendor/a_b_plugin/Rakefile
  52. +30 −0 vendor/a_b_plugin/a_b_plugin.gemspec
  53. +2 −2 vendor/a_b_plugin/bin/a_b
  54. +1 −1 vendor/a_b_plugin/init.rb
  55. +19 −4 vendor/a_b_plugin/lib/a_b_plugin.rb
  56. +3 −0 vendor/a_b_plugin/lib/a_b_plugin/version.rb
  57. +1 −2 vendor/a_b_plugin/rails/init.rb
  58. +0 −58 vendor/a_b_plugin/require.rb
  59. +1 −1 vendor/a_b_plugin/spec/a_b_plugin/cookies_spec.rb
  60. +1 −1 vendor/a_b_plugin/spec/a_b_plugin/test_spec.rb
  61. +7 −6 vendor/a_b_plugin/spec/a_b_plugin_spec.rb
  62. +1 −1 vendor/a_b_plugin/spec/fixtures/rails/app/controllers/application_controller.rb
  63. +1 −1 vendor/a_b_plugin/spec/fixtures/rails/app/helpers/application_helper.rb
  64. +1 −1 vendor/a_b_plugin/spec/fixtures/rails/config/boot.rb
  65. +1 −1 vendor/a_b_plugin/spec/fixtures/rails/config/initializers/inflections.rb
  66. +1 −1 vendor/a_b_plugin/spec/fixtures/rails/config/initializers/mime_types.rb
  67. +1 −1 vendor/a_b_plugin/spec/fixtures/rails/config/initializers/session_store.rb
  68. +1 −1 vendor/a_b_plugin/spec/fixtures/rails/config/routes.rb
  69. +22 −3 vendor/a_b_plugin/spec/spec_helper.rb
View
@@ -1,6 +1,5 @@
.DS_Store
*.gem
-*.gemspec
*.log
config/database.yml
config/deploy.rb
View
57 Gemfile
@@ -0,0 +1,57 @@
+source "http://rubygems.org"
+
+v = {
+ :active_wrapper => '=0.2.7',
+ :bundler => '=1.0.0.beta.2',
+ :cucumber => '=0.6.2',
+ :haml => '=2.2.17',
+ :lilypad => '=0.3.0',
+ :rack_flash => '=0.1.1',
+ :rack_test => '=0.5.3',
+ :rake => '=0.8.7',
+ :rspec => '=1.3.0',
+ :sinatra => '=1.0'
+}
+
+group :console do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper)
+ gem 'sinatra', v[:sinatra], :require => %w(sinatra/base)
+end
+
+group :gemspec do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper)
+ gem 'bundler', v[:bundler]
+ gem 'haml', v[:haml]
+ gem 'lilypad', v[:lilypad]
+ gem 'rack-flash', v[:rack_flash]
+ gem 'sinatra', v[:sinatra]
+end
+
+group :gemspec_dev do
+ gem 'cucumber', v[:cucumber]
+ gem 'rspec', v[:rspec]
+ gem 'rack-test', v[:rack_test]
+end
+
+group :lib do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper)
+ gem 'haml', v[:haml], :require => %w(haml sass)
+ gem 'lilypad', v[:lilypad], :require => %w(lilypad)
+ gem 'rack-flash', v[:rack_flash], :require => %w(rack-flash)
+ gem 'sinatra', v[:sinatra], :require => %w(sinatra/base)
+end
+
+group :rake do
+ gem 'active_wrapper', v[:active_wrapper], :require => %w(active_wrapper/tasks)
+ gem 'rake', v[:rake], :require => %w(rake rake/gempackagetask)
+ gem 'rspec', v[:rspec], :require => %w(spec/rake/spectask)
+end
+
+group :spec do
+ gem 'rack-test', v[:rack_test], :require => %w(rack/test)
+ gem 'rspec', v[:rspec], :require => %w(
+ spec/adapters/mock_frameworks/rspec
+ spec/runner/formatter/progress_bar_formatter
+ spec/runner/formatter/text_mate_formatter
+ )
+end
View
@@ -0,0 +1,103 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ actionmailer (2.3.5)
+ actionpack (= 2.3.5)
+ actionmailer (2.3.5)
+ actionpack (= 2.3.5)
+ actionpack (2.3.5)
+ activesupport (= 2.3.5)
+ rack (~> 1.0.0)
+ actionpack (2.3.5)
+ activesupport (= 2.3.5)
+ rack (~> 1.0.0)
+ active_wrapper (0.2.7)
+ actionmailer (= 2.3.5)
+ activerecord (= 2.3.5)
+ active_wrapper (0.2.7)
+ actionmailer (= 2.3.5)
+ activerecord (= 2.3.5)
+ activerecord (2.3.5)
+ activesupport (= 2.3.5)
+ activerecord (2.3.5)
+ activesupport (= 2.3.5)
+ activesupport (2.3.5)
+ activesupport (2.3.5)
+ builder (2.1.2)
+ builder (2.1.2)
+ cucumber (0.6.2)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ json_pure (>= 1.2.0)
+ polyglot (>= 0.2.9)
+ term-ansicolor (>= 1.0.4)
+ treetop (>= 1.4.2)
+ cucumber (0.6.2)
+ builder (>= 2.1.2)
+ diff-lcs (>= 1.1.2)
+ json_pure (>= 1.2.0)
+ polyglot (>= 0.2.9)
+ term-ansicolor (>= 1.0.4)
+ treetop (>= 1.4.2)
+ diff-lcs (1.1.2)
+ diff-lcs (1.1.2)
+ haml (2.2.17)
+ haml (2.2.17)
+ json_pure (1.2.0)
+ json_pure (1.2.0)
+ lilypad (0.3.0)
+ builder (>= 2.1.2)
+ lilypad (0.3.0)
+ builder (>= 2.1.2)
+ polyglot (0.2.9)
+ polyglot (0.2.9)
+ rack (1.0.1)
+ rack (1.0.1)
+ rack-flash (0.1.1)
+ rack
+ rack-flash (0.1.1)
+ rack
+ rack-test (0.5.3)
+ rack (>= 1.0)
+ rack-test (0.5.3)
+ rack (>= 1.0)
+ rake (0.8.7)
+ rake (0.8.7)
+ rspec (1.3.0)
+ rspec (1.3.0)
+ sinatra (1.0)
+ rack (>= 1.0)
+ sinatra (1.0)
+ rack (>= 1.0)
+ term-ansicolor (1.0.4)
+ term-ansicolor (1.0.4)
+ treetop (1.4.3)
+ polyglot (>= 0.2.5)
+ treetop (1.4.3)
+ polyglot (>= 0.2.5)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ active_wrapper (= 0.2.7)
+ active_wrapper (= 0.2.7)
+ active_wrapper (= 0.2.7)
+ active_wrapper (= 0.2.7)
+ bundler (= 1.0.0.beta.2)
+ cucumber (= 0.6.2)
+ haml (= 2.2.17)
+ haml (= 2.2.17)
+ lilypad (= 0.3.0)
+ lilypad (= 0.3.0)
+ rack-flash (= 0.1.1)
+ rack-flash (= 0.1.1)
+ rack-test (= 0.5.3)
+ rack-test (= 0.5.3)
+ rake (= 0.8.7)
+ rspec (= 1.3.0)
+ rspec (= 1.3.0)
+ rspec (= 1.3.0)
+ sinatra (= 1.0)
+ sinatra (= 1.0)
+ sinatra (= 1.0)
View
@@ -1,4 +1,4 @@
-Copyright (c) 2009 Winton Welsh
+Copyright (c) 2010 Winton Welsh
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
@@ -15,4 +15,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1,4 +1,4 @@
-GemTemplate
+ABFrontEnd
===========
A gem template for new projects.
@@ -33,4 +33,4 @@ stencil a_b_front_end
rake rename
</pre>
-The last command does a find-replace (gem\_template -> my\_project) on files and filenames.
+The last command does a find-replace (gem\_template -> my\_project) on files and filenames.
View
@@ -1,5 +1,14 @@
-require "#{File.dirname(__FILE__)}/require"
-Require.rakefile!
+require 'rubygems'
+require 'bundler'
+
+Bundler.require(:rake)
+
+def gemspec
+ @gemspec ||= begin
+ file = File.expand_path('../a_b_front_end.gemspec', __FILE__)
+ eval(File.read(file), binding, file)
+ end
+end
if defined?(ActiveWrapper::Tasks)
ActiveWrapper::Tasks.new(
@@ -8,23 +17,32 @@ if defined?(ActiveWrapper::Tasks)
)
end
-# You can delete this after you use it
-desc "Rename project"
-task :rename do
- name = ENV['NAME'] || File.basename(Dir.pwd)
- begin
- dir = Dir['**/gem_template*']
- from = dir.pop
- if from
- rb = from.include?('.rb')
- to = File.dirname(from) + "/#{name}#{'.rb' if rb}"
- FileUtils.mv(from, to)
- end
- end while dir.length > 0
- Dir["**/*"].each do |path|
- next if path.include?('Rakefile')
- if File.file?(path)
- `sed -i "" 's/gem_template/#{name}/g' #{path}`
- end
+if defined?(Rake::GemPackageTask)
+ Rake::GemPackageTask.new(gemspec) do |pkg|
+ pkg.gem_spec = gemspec
+ end
+ task :gem => :gemspec
+end
+
+if defined?(Spec::Rake::SpecTask)
+ desc "Run specs"
+ Spec::Rake::SpecTask.new do |t|
+ t.spec_files = FileList['spec/**/*_spec.rb']
+ t.spec_opts = %w(-fs --color)
+ t.warning = true
end
-end
+ task :spec
+end
+
+desc "Install gem locally"
+task :install => :package do
+ sh %{gem install pkg/#{gemspec.name}-#{gemspec.version}}
+end
+
+desc "Validate the gemspec"
+task :gemspec do
+ gemspec.validate
+end
+
+task :package => :gemspec
+task :default => :spec
View
@@ -0,0 +1,30 @@
+# -*- encoding: utf-8 -*-
+lib = File.expand_path('../lib/', __FILE__)
+$:.unshift lib unless $:.include?(lib)
+
+require 'a_b_front_end/version'
+require 'rubygems'
+require 'bundler'
+
+Gem::Specification.new do |s|
+ s.name = "a_b_front_end"
+ s.version = ABFrontEnd::VERSION
+ s.platform = Gem::Platform::RUBY
+ s.authors = ["Winton Welsh"]
+ s.email = ["mail@wintoni.us"]
+ s.homepage = "http://github.com/winton/a_b_front_end"
+ s.summary = ""
+ s.description = ""
+
+ Bundler.definition.dependencies.each do |dep|
+ if dep.groups.include?(:gemspec)
+ s.add_dependency dep.name, dep.requirement
+ elsif dep.groups.include?(:gemspec_dev)
+ s.add_development_dependency dep.name, dep.requirement
+ end
+ end
+
+ s.files = Dir.glob("{bin,lib}/**/*") + %w(LICENSE README.md)
+ s.executables = Dir.glob("{bin}/*").collect { |f| File.basename(f) }
+ s.require_path = 'lib'
+end
View
@@ -1,3 +1,3 @@
require "#{File.dirname(__FILE__)}/lib/a_b_front_end"
-run Application
+run Application
View
@@ -1,2 +1,2 @@
token: UAkc328OcjMVFbPAE5bo
-url: http://localhost:9394
+url: http://localhost:9394
@@ -3,4 +3,4 @@ development:
database: a_b_front_end
username: root
password:
- host: localhost
+ host: localhost
View
@@ -3,4 +3,4 @@ a_b_plugin:
path: vendor
authlogic:
repo: git@github.com:winton/authlogic.git
- path: vendor
+ path: vendor
View
@@ -13,4 +13,4 @@ production:
password: password
port: 587
enable_starttls_auto: true
- user_name: test@mydomain.com
+ user_name: test@mydomain.com
View
@@ -22,4 +22,4 @@ def self.up
def self.down
drop_table :users
end
-end
+end
View
@@ -7,4 +7,4 @@ Feature: Example
Scenario: I do something
/Given
/When
- /Then
+ /Then
View
@@ -36,4 +36,4 @@ def app
include Test::Unit::Assertions
include Webrat::Matchers
include Webrat::Methods
-end
+end
@@ -8,4 +8,4 @@
ensure
$rspec_mocks.reset_all
end
-end
+end
@@ -1,3 +1,3 @@
Webrat.configure do |config|
config.mode = :rack
-end
+end
View
@@ -1,2 +1,18 @@
-require File.expand_path("#{File.dirname(__FILE__)}/../require")
-Require.lib!
+require 'rubygems'
+require 'bundler'
+
+Bundler.require(:lib)
+
+$:.unshift File.dirname(__FILE__) + '/a_b_front_end'
+
+require 'version'
+
+require 'boot/application'
+require 'boot/sinatra'
+require 'boot/session'
+require 'boot/flash'
+require 'boot/active_wrapper'
+require 'boot/lilypad'
+require 'boot/controller'
+require 'boot/helper'
+require 'boot/model'
@@ -9,4 +9,4 @@
$db.establish_connection
ActionMailer::Base.raise_delivery_errors = true
-end
+end
@@ -1,2 +1,2 @@
class Application < Sinatra::Base
-end
+end
Oops, something went wrong.

0 comments on commit 6fa9538

Please sign in to comment.